[lxc-devel] [lxd/master] Storage: LVM test tweaks and liblxc nil check

tomponline on Github lxc-bot at linuxcontainers.org
Thu Aug 6 10:14:18 UTC 2020


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 301 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20200806/46d48fc1/attachment-0001.bin>
-------------- next part --------------
From fdb856770c5cf13b1da81eb3d55cfd9d69abb66c Mon Sep 17 00:00:00 2001
From: Thomas Parrott <thomas.parrott at canonical.com>
Date: Thu, 6 Aug 2020 11:02:54 +0100
Subject: [PATCH 1/2] test/suites/storage: LVM size tweaks

Signed-off-by: Thomas Parrott <thomas.parrott at canonical.com>
---
 test/suites/storage.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/test/suites/storage.sh b/test/suites/storage.sh
index 75eeb13cf6..6890228a4a 100644
--- a/test/suites/storage.sh
+++ b/test/suites/storage.sh
@@ -765,12 +765,12 @@ test_storage() {
 
   if [ "$lxd_backend" = "lvm" ]; then
     QUOTA1="20MB"
-    rootMinKB1="17000"
+    rootMinKB1="14000"
     rootMaxKB1="20000"
 
     # Increase quota enough to require a new 4MB LVM extent.
     QUOTA2="25MB"
-    rootMinKB2="21000"
+    rootMinKB2="19000"
     rootMaxKB2="23000"
   fi
 

From 656dd4ff372851d8a1d98128837c6d0072e93504 Mon Sep 17 00:00:00 2001
From: Thomas Parrott <thomas.parrott at canonical.com>
Date: Thu, 6 Aug 2020 11:13:35 +0100
Subject: [PATCH 2/2] lxd/instance/drivers/driver/lxc: Adds nil check in
 getLxcState

Signed-off-by: Thomas Parrott <thomas.parrott at canonical.com>
---
 lxd/instance/drivers/driver_lxc.go | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/lxd/instance/drivers/driver_lxc.go b/lxd/instance/drivers/driver_lxc.go
index 6b3de9a40e..85b796ac91 100644
--- a/lxd/instance/drivers/driver_lxc.go
+++ b/lxd/instance/drivers/driver_lxc.go
@@ -3041,6 +3041,10 @@ func (c *lxc) getLxcState() (liblxc.State, error) {
 		return liblxc.StateMap["STOPPED"], err
 	}
 
+	if c.c == nil {
+		return liblxc.StateMap["STOPPED"], nil
+	}
+
 	monitor := make(chan liblxc.State, 1)
 
 	go func(c *liblxc.Container) {


More information about the lxc-devel mailing list