virt-manager/eb92178e-virtinst-fix-storage-pool-lookup.patch
2015-09-02 20:04:59 +00:00

37 lines
1.3 KiB
Diff

Subject: storage: fix default storage pool lookup
From: Charles Arnold carnold@suse.com Wed Aug 12 16:00:14 2015 -0600
Date: Mon Aug 31 18:25:37 2015 -0400:
Git: eb92178e0c208c20c658dd3f38caf377bb788ae4
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.
Signed-off-by: Charles Arnold <carnold@suse.com>
(crobinso: Remove now-redundant 'pass')
diff --git a/virtinst/storage.py b/virtinst/storage.py
index 285acb8..d3d867a 100644
--- a/virtinst/storage.py
+++ b/virtinst/storage.py
@@ -209,10 +209,12 @@ class StoragePool(_StorageObject):
try:
pool = conn.storagePoolLookupByName(name)
except libvirt.libvirtError:
- pass
+ # Try default pool path when "default" name fails
+ pool = StoragePool.lookup_pool_by_path(conn, path)
if pool:
- return
+ # This is a libvirt pool object so create a StoragePool from it
+ return StoragePool(conn, parsexml=pool.XMLDesc(0))
try:
logging.debug("Attempting to build default pool with target '%s'",