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

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