Blame SOURCES/virt-manager-virt-manager-delete-fix-path-for-disk-type-volume.patch

e2df08
From 6f2711641ac3be709c0d9b4a66c9427358809b8c Mon Sep 17 00:00:00 2001
e2df08
From: Giuseppe Scrivano <gscrivan@redhat.com>
e2df08
Date: Thu, 9 Oct 2014 11:06:51 +0200
e2df08
Subject: [PATCH 1/3] virt-manager, delete: fix path for disk type='volume'
e2df08
e2df08
Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1146869
e2df08
e2df08
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
e2df08
(cherry picked from commit 8f1aa5a4f002aa139faba63cfda3cedd9df7032a)
e2df08
---
e2df08
 virtManager/delete.py | 14 ++++++++++++--
e2df08
 1 file changed, 12 insertions(+), 2 deletions(-)
e2df08
e2df08
diff --git a/virtManager/delete.py b/virtManager/delete.py
e2df08
index 1aa8180..8a58191 100644
e2df08
--- a/virtManager/delete.py
e2df08
+++ b/virtManager/delete.py
e2df08
@@ -232,8 +232,18 @@ def populate_storage_list(storage_list, vm, conn):
e2df08
     model = storage_list.get_model()
e2df08
     model.clear()
e2df08
 
e2df08
-    diskdata = [(disk.target, disk.path, disk.read_only, disk.shareable) for
e2df08
-                disk in vm.get_disk_devices()]
e2df08
+    def get_path(disk):
e2df08
+        if disk.sourcePool:
e2df08
+            try:
e2df08
+                pool = conn.get_pool(disk.sourcePool)
e2df08
+                vol = pool.get_volume(disk.path)
e2df08
+                return vol.get_target_path()
e2df08
+            except KeyError:
e2df08
+                return disk.path
e2df08
+        return disk.path
e2df08
+
e2df08
+    diskdata = [(d.target, get_path(d), d.read_only, d.shareable) for
e2df08
+                d in vm.get_disk_devices()]
e2df08
 
e2df08
     diskdata.append(("kernel", vm.get_xmlobj().os.kernel, True, False))
e2df08
     diskdata.append(("initrd", vm.get_xmlobj().os.initrd, True, False))
e2df08
-- 
e2df08
1.9.3
e2df08