File a0ca387a-cli-Fix-pool-default-when-path-belongs-to-another-pool.patch of Package virt-manager

Subject: cli: Fix pool=default when path belongs to another pool (bz 1692489)
From: Cole Robinson crobinso@redhat.com Tue Mar 26 10:44:58 2019 -0400
Date: Tue Mar 26 11:15:46 2019 -0400:
Git: a0ca387aad0fde19683aa8b5b5636add6455b8b4

Using 'virt-install --disk size=X' implicitly uses pool=default. If
a pool named 'default' exists we use that; if not, and a pool using
the default path exists under a different name, we attempt to use
that as well, and if that doesn't exist, we create pool=default

The second case is broken, so if there's no pool=default and eg.
pool=FOO points to /var/lib/libvirt/images, we still attempt to
look up pool=default which understandably fails

https://bugzilla.redhat.com/show_bug.cgi?id=1692489

Index: virt-manager-2.1.0/virtinst/cli.py
===================================================================
--- virt-manager-2.1.0.orig/virtinst/cli.py
+++ virt-manager-2.1.0/virtinst/cli.py
@@ -2263,7 +2263,9 @@ class ParserDisk(VirtCLIParser):
         poolobj = None
         if poolname:
             if poolname == "default":
-                StoragePool.build_default_pool(self.guest.conn)
+                poolxml = StoragePool.build_default_pool(self.guest.conn)
+                if poolxml:
+                    poolname = poolxml.name
             poolobj = self.guest.conn.storagePoolLookupByName(poolname)
 
         if volname:
openSUSE Build Service is sponsored by