[virt-tools-list] [virt-manager PATCH] details: disable "Remove Hardware" popup menu for USB controller

Chen Hanxiao chen_han_xiao at 126.com
Thu Apr 17 15:13:48 UTC 2014


From: Chen Hanxiao <chenhanxiao at cn.fujitsu.com>

We could not delete USB controller by "Remove" button.
But we could delete it by right click option.
This patch will disable remove popup menu for USB controller.

Signed-off-by: Chen Hanxiao <chenhanxiao at cn.fujitsu.com>
---
 virtManager/details.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/virtManager/details.py b/virtManager/details.py
index 2e8991b..beb2dcd 100644
--- a/virtManager/details.py
+++ b/virtManager/details.py
@@ -1081,7 +1081,8 @@ class vmmDetails(vmmGObjectUI):
             return
 
         rmdev = self._addhwmenuitems["remove"]
-        if hasattr(devobj, "virtual_device_type"):
+        if (hasattr(devobj, "virtual_device_type") and
+                devobj.type != "usb"):
             rmdev.show()
         else:
             rmdev.hide()
-- 
1.9.0





More information about the virt-tools-list mailing list