[virt-tools-list] [PATCH virt-manager] match usb device with vendorID, productID, bus, device

Guannan Ren gren at redhat.com
Tue May 8 13:37:17 UTC 2012


---
 src/virtManager/details.py |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/virtManager/details.py b/src/virtManager/details.py
index 5395087..379470d 100644
--- a/src/virtManager/details.py
+++ b/src/virtManager/details.py
@@ -287,9 +287,11 @@ def lookup_nodedev(vmmconn, hostdev):
 
     devs = vmmconn.get_nodedevs(devtype, None)
     for dev in devs:
-        # Try to get info from {product|vendor}_id
+        # Try to match with product_id|vendor_id|bus|device
         if (attrVal(dev, "product_id") == product_id and
-            attrVal(dev, "vendor_id") == vendor_id):
+            attrVal(dev, "vendor_id") == vendor_id and
+            attrVal(dev, "bus") == bus and
+            attrVal(dev, "device") == device):
             found_dev = dev
             break
         else:
-- 
1.7.7.5




More information about the virt-tools-list mailing list