File virtinst-fix-storage-pool-lookup.patch of Package virt-manager.1480

References: bsc#941464
virt-convert fails when the storage pool is already present but
is not called 'default'.

If the 'default' pool has been removed but another pool uses the
default location of /var/lib/libvirt/images virt-convert will fail
to find the pool and attempt to create another one with the same
path. This causes the conversion to fail.
Index: virt-manager-1.0.1/virtinst/storage.py
===================================================================
--- virt-manager-1.0.1.orig/virtinst/storage.py
+++ virt-manager-1.0.1/virtinst/storage.py
@@ -191,10 +191,11 @@ class StoragePool(_StorageObject):
         try:
             pool = conn.storagePoolLookupByName(name)
         except libvirt.libvirtError:
+            pool = StoragePool.lookup_pool_by_path(conn, path)
             pass
 
         if pool:
-            return
+            return StoragePool(conn, parsexml=pool.XMLDesc(0))
 
         try:
             logging.debug("Attempting to build default pool with target '%s'",
openSUSE Build Service is sponsored by