[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [libvirt] [PATCH v2 0/3]usb devices with same vendorID, productID hotplug support

On 2012年05月01日 16:16, Guannan Ren wrote:


The set of patch tries to fix the issue when multiple usb devices with
same idVendor, idProduct are availible on host,  the usb device with
lowest bus:device will be attached to guest if usb xml file is given like

<hostdev mode='subsystem' type='usb' managed='yes'>
     <vendor id='0x15e1'/>
     <product id='0x2007'/>

The reason is that the usb hotplug function searchs usb device in system files
to match vendor and product id, the file with lowest number is always found

After fix, in this case, libvirt will report an error as follows:
At the same time, the usb part of domain initilization is also update in patch 2/3

# virsh attach-device rhel6u1 /tmp/usb.xml
error: Failed to attach device from /tmp/usb.xml
error: XML error: multiple USB deivces 15e1:2007, use<address>  to specify one.

The error could be more clear, e.g.

multiple USB deivces for vendor='15e1',
product='2007', use <address> to specify one.

And it's not "XML error", the XML is just fine. The XML with
only 'vendor' and 'product' specified could still work well
if no mulitple devices with the same vendor and product.

Perhaps VIR_ERR_INTERNAL_ERROR is a good choice.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]