Blame SOURCES/virt-manager-cli-Fix-pool-default-when-path-belongs-to-another-pool-bz-1692489.patch

3d61c0
From ed11328d558f746585d21c8da827cba6298f3ace Mon Sep 17 00:00:00 2001
3d61c0
Message-Id: <ed11328d558f746585d21c8da827cba6298f3ace@dist-git>
3d61c0
From: Pavel Hrdina <phrdina@redhat.com>
3d61c0
Date: Tue, 26 Mar 2019 10:44:58 -0400
3d61c0
Subject: [PATCH] cli: Fix pool=default when path belongs to another pool (bz
3d61c0
 1692489)
3d61c0
3d61c0
From: Cole Robinson <crobinso@redhat.com>
3d61c0
3d61c0
Using 'virt-install --disk size=X' implicitly uses pool=default. If
3d61c0
a pool named 'default' exists we use that; if not, and a pool using
3d61c0
the default path exists under a different name, we attempt to use
3d61c0
that as well, and if that doesn't exist, we create pool=default
3d61c0
3d61c0
The second case is broken, so if there's no pool=default and eg.
3d61c0
pool=FOO points to /var/lib/libvirt/images, we still attempt to
3d61c0
look up pool=default which understandably fails
3d61c0
3d61c0
https://bugzilla.redhat.com/show_bug.cgi?id=1692489
3d61c0
(cherry picked from commit a0ca387aad0fde19683aa8b5b5636add6455b8b4)
3d61c0
3d61c0
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1711806
3d61c0
3d61c0
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
3d61c0
Reviewed-by: Cole Robinson <crobinso@redhat.com>
3d61c0
---
3d61c0
 virtinst/cli.py | 4 +++-
3d61c0
 1 file changed, 3 insertions(+), 1 deletion(-)
3d61c0
3d61c0
diff --git a/virtinst/cli.py b/virtinst/cli.py
3d61c0
index 2cd86ca6..55314d56 100644
3d61c0
--- a/virtinst/cli.py
3d61c0
+++ b/virtinst/cli.py
3d61c0
@@ -2075,7 +2075,9 @@ class ParserDisk(VirtCLIParser):
3d61c0
         poolobj = None
3d61c0
         if poolname:
3d61c0
             if poolname == "default":
3d61c0
-                StoragePool.build_default_pool(self.guest.conn)
3d61c0
+                poolxml = StoragePool.build_default_pool(self.guest.conn)
3d61c0
+                if poolxml:
3d61c0
+                    poolname = poolxml.name
3d61c0
             poolobj = self.guest.conn.storagePoolLookupByName(poolname)
3d61c0
 
3d61c0
         if volname:
3d61c0
-- 
3d61c0
2.21.0
3d61c0