match usb device with vendorID, productID, bus, device

(crobinso: add Guannan to AUTHORS)
This commit is contained in:
Guannan Ren 2012-05-08 21:37:17 +08:00 committed by Cole Robinson
parent c5a10caae3
commit 9929d8b21e
2 changed files with 5 additions and 2 deletions

View File

@ -79,6 +79,7 @@ Further patches have been submitted by:
Brian J. Murrell <brian-at-interlinx-dot-bc-dot-ca>
Tuomas Jormola <tj-at-solitudo-dot-net>
Nathan Bird <nathan-at-acceleration-dot-net>
Guannan Ren <gren-at-redhat-dot-com>
<...send a patch & get your name here...>

View File

@ -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: