[virt-tools-list] [virt-manager PATCH 2/2] virt-manager, details: fix path and size for disk type='volume'

Giuseppe Scrivano gscrivan at redhat.com
Fri Sep 26 13:28:47 UTC 2014


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

Signed-off-by: Giuseppe Scrivano <gscrivan at redhat.com>
---
 virtManager/details.py | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/virtManager/details.py b/virtManager/details.py
index b27e62b..3d83193 100644
--- a/virtManager/details.py
+++ b/virtManager/details.py
@@ -2559,6 +2559,7 @@ class vmmDetails(vmmGObjectUI):
             return
 
         path = disk.path
+        source_pool = disk.sourcePool
         devtype = disk.device
         ro = disk.read_only
         share = disk.shareable
@@ -2584,7 +2585,13 @@ class vmmDetails(vmmGObjectUI):
         if not path:
             size = "-"
         else:
-            vol = self.conn.get_vol_by_path(path)
+            if source_pool:
+                pool = self.conn.get_pool(source_pool)
+                if pool:
+                    vol = pool.get_volume(path)
+            else:
+                vol = self.conn.get_vol_by_path(path)
+
             if vol:
                 size = vol.get_pretty_capacity()
             elif not self.conn.is_remote():
-- 
1.9.3




More information about the virt-tools-list mailing list