[virt-tools-list] [PATCH v2 6/6] details: Show attached disk information in scsi controller page

Lin Ma lma at suse.com
Thu Nov 23 09:32:50 UTC 2017


It helps users to recognize controllers <-> disks mapping relationship.

Signed-off-by: Lin Ma <lma at suse.com>
---
 virtManager/details.py | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/virtManager/details.py b/virtManager/details.py
index f284690e..4bc84570 100644
--- a/virtManager/details.py
+++ b/virtManager/details.py
@@ -3014,10 +3014,17 @@ class vmmDetails(vmmGObjectUI):
         if controller.type == "pci":
             can_remove = False
         if controller.type == "scsi":
+            model = self.widget("controller-device-list").get_model()
+            model.clear()
             for disk in self.vm.get_disk_devices():
                 if disk.address.compare_controller(controller, disk.bus):
                     can_remove = False
-                    break
+                    name = _label_for_device(disk)
+                    infoStr = ("%s on %s" % (name, disk.address.pretty_desc()))
+                    model.append([infoStr])
+            uiutil.set_grid_row_visible(self.widget("device-list-label"), True)
+            uiutil.set_grid_row_visible(self.widget("controller-device-box"), True)
+
         self.widget("config-remove").set_sensitive(can_remove)
 
         type_label = controller.pretty_desc()
-- 
2.14.0




More information about the virt-tools-list mailing list