[PATCH virt-manager v1 3/3] virtManager: change MDEV display names

Shalini Chellathurai Saroja shalini at linux.ibm.com
Wed Nov 10 10:28:33 UTC 2021


The MDEV devices listed in the "Add New Virtual Hardware" page, are a
concatenation of parent device name and MDEV device name, eg:
css_0_0_0014 mdev_b204c698_6731_4f25_b5f4_894614a05ec0_0_0_0014. The
parent name is duplicated in here, as the MDEV device name itself
includes a part of parent name in libvirt version 7.8.0 and later. So,
this patch changes the MDEVs listed in "Add New Virtual Hardware" page
to only display the MDEV device
name(eg:mdev_b204c698_6731_4f25_b5f4_894614a05ec0_0_0_0014).

Signed-off-by: Shalini Chellathurai Saroja <shalini at linux.ibm.com>
---
 virtManager/addhardware.py | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/virtManager/addhardware.py b/virtManager/addhardware.py
index 13b899c3..ee5fa149 100644
--- a/virtManager/addhardware.py
+++ b/virtManager/addhardware.py
@@ -782,12 +782,6 @@ class vmmAddHardware(vmmGObjectUI):
                     if dev.xmlobj.name == subdev.xmlobj.parent:
                         prettyname += " (%s)" % subdev.pretty_name()
 
-            if devtype == "mdev":
-                for parentdev in self.conn.list_nodedevs():
-                    if dev.xmlobj.parent == parentdev.xmlobj.name:
-                        prettyname = "%s %s" % (
-                                parentdev.pretty_name(), prettyname)
-
             model.append([dev.xmlobj, prettyname])
 
         if len(model) == 0:
-- 
2.30.2




More information about the virt-tools-list mailing list