[virt-tools-list] [virt-manager PATCH] virt-manager, delete: fix path for disk type='volume'

Giuseppe Scrivano gscrivan at redhat.com
Thu Oct 9 09:17:03 UTC 2014


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

Signed-off-by: Giuseppe Scrivano <gscrivan at redhat.com>
---
 virtManager/delete.py | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/virtManager/delete.py b/virtManager/delete.py
index 248392f..b865d18 100644
--- a/virtManager/delete.py
+++ b/virtManager/delete.py
@@ -232,8 +232,17 @@ def populate_storage_list(storage_list, vm, conn):
     model = storage_list.get_model()
     model.clear()
 
-    diskdata = [(disk.target, disk.path, disk.read_only, disk.shareable) for
-                disk in vm.get_disk_devices()]
+    def get_path(disk):
+        if disk.sourcePool:
+            pool = conn.get_pool(disk.sourcePool)
+            if pool:
+                vol = pool.get_volume(disk.path)
+                if vol:
+                    return vol.get_target_path()
+        return disk.path
+
+    diskdata = [(d.target, get_path(d), d.read_only, d.shareable) for
+                d in vm.get_disk_devices()]
 
     diskdata.append(("kernel", vm.get_xmlobj().os.kernel, True, False))
     diskdata.append(("initrd", vm.get_xmlobj().os.initrd, True, False))
-- 
1.9.3




More information about the virt-tools-list mailing list