summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShalini Chellathurai Saroja <shalini@linux.ibm.com>2021-11-12 11:51:49 +0100
committerCole Robinson <crobinso@redhat.com>2022-01-19 14:24:14 -0500
commitca8950f0ed2d440bc3e5a8a358bd6abb1b7aa9c4 (patch)
tree65b26a4282aec152a40d4ebcbb3af5d284d4ea86
parent9e133de21af7368c64f1fc651207ac48b82770f2 (diff)
downloadvirt-manager-ca8950f0ed2d440bc3e5a8a358bd6abb1b7aa9c4.tar.gz
virtManager: change MDEV display names
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 the 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), when the new naming convention is used. Signed-off-by: Shalini Chellathurai Saroja <shalini@linux.ibm.com>
-rw-r--r--virtManager/addhardware.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/virtManager/addhardware.py b/virtManager/addhardware.py
index 13b899c3..132ba4e0 100644
--- a/virtManager/addhardware.py
+++ b/virtManager/addhardware.py
@@ -782,7 +782,9 @@ class vmmAddHardware(vmmGObjectUI):
if dev.xmlobj.name == subdev.xmlobj.parent:
prettyname += " (%s)" % subdev.pretty_name()
- if devtype == "mdev":
+ # parent device names are appended with mdev names in
+ # libvirt 7.8.0
+ if devtype == "mdev" and len(prettyname) <= 41:
for parentdev in self.conn.list_nodedevs():
if dev.xmlobj.parent == parentdev.xmlobj.name:
prettyname = "%s %s" % (