[libvirt] [PATCH 1/3] usb: create functions to search usb device accurately

Osier Yang jyang at redhat.com
Fri May 4 05:48:02 UTC 2012


On 2012年05月04日 12:39, Guannan Ren wrote:
> On 05/04/2012 05:38 AM, Eric Blake wrote:
>> On 05/03/2012 03:21 PM, Eric Blake wrote:
>>> On 05/03/2012 04:51 AM, Guannan Ren wrote:
>>>> usbFindDevice():get usb device according to
>>>> idVendor, idProduct, bus, device
>>>> it is the exact match of the four parameters
>>>>
>>>> usbFindDeviceByBus():get usb device according to bus, device
>>>> it returns only one usb device same as usbFindDevice
>>>>
>>>> usbFindDeviceByVendor():get usb device according to idVendor,idProduct
>>>> it probably returns multiple usb devices.
>>>>
>>>> usbDeviceSearch(): a helper function to do the actual search
>>>> ---
>>>> src/libvirt_private.syms | 2 +
>>>> src/util/hostusb.c | 209 +++++++++++++++++++++++++++++++++-------------
>>>> src/util/hostusb.h | 22 ++++--
>>>> 3 files changed, 170 insertions(+), 63 deletions(-)
>> This patch doesn't even compile!
>>
>> qemu/qemu_hostdev.c: In function 'qemuPrepareHostdevUSBDevices':
>> qemu/qemu_hostdev.c:599:33: error: too few arguments to function
>> 'usbFindDevice'
>> ../src/util/hostusb.h:40:13: note: declared here
>>
>> You can't change the signature of usbFindDevice unless you update all
>> callers in the same patch.
>
> I compiled it and tested it , then sent it out.
> I think the changes on usbFindDevice caller is in PATCH2/3 and PATCH 3/3
> "usb = usbFindDevice(vendor, product, bus, device);" are there.


No, every patch shouldn't break the build. You have to update
all callers of usbFindDevice together with this patch.

Regards,
Osier




More information about the libvir-list mailing list