[lxc-devel] [lxd/master] lvm: allow non-empty VGs when thinpool exists

brauner on Github lxc-bot at linuxcontainers.org
Tue Jun 27 17:16:23 UTC 2017


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 381 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20170627/eb2333f6/attachment.bin>
-------------- next part --------------
From 259893861365887c67ac8e3c22df04414bedc5ab Mon Sep 17 00:00:00 2001
From: Christian Brauner <christian.brauner at ubuntu.com>
Date: Tue, 27 Jun 2017 19:14:46 +0200
Subject: [PATCH] lvm: allow non-empty VGs when thinpool exists

Closes #3456.

Signed-off-by: Christian Brauner <christian.brauner at ubuntu.com>
---
 lxd/storage_lvm.go | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lxd/storage_lvm.go b/lxd/storage_lvm.go
index 8bd6098e8..13b3abf3b 100644
--- a/lxd/storage_lvm.go
+++ b/lxd/storage_lvm.go
@@ -260,11 +260,11 @@ func (s *storageLvm) StoragePoolCreate() error {
 		}
 
 		empty := true
-		if count > 1 || count == 1 && !s.useThinpool {
+		if count >= 1 && !s.useThinpool {
 			empty = false
 		}
 
-		if count == 1 && s.useThinpool {
+		if s.useThinpool {
 			ok, err := storageLVMThinpoolExists(poolName, s.thinPoolName)
 			if err != nil {
 				logger.Errorf("failed to determine whether thinpool \"%s\" exists in volume group \"%s\": %s", poolName, s.thinPoolName, err)


More information about the lxc-devel mailing list