[libvirt] [PATCH v2 2/3] qemu: make use of usb search function to initialize usb devices

Eric Blake eblake at redhat.com
Wed May 2 17:29:57 UTC 2012


On 05/01/2012 02:16 AM, Guannan Ren wrote:
> refactor qemuPrepareHostdevUSBDevices function, make it focus on
> adding usb device to activeUsbHostdevs after check. After that,
> the usb hotplug function qemuDomainAttachHostDevice also could use
> it.
> 
> expand qemuPrepareHostUSBDevices to perform the usb search,
> rollback on failure.
> ---

>  
> +        if (vendor && bus) {
> +            usb = usbFindDevice(vendor, product, bus, device);

Can bus be 0, or does the USB bus numbering start with 1?  If 0 is a
valid bus number, then you need to know whether bus was specified, not
whether it is non-zero.

> +        } else if (vendor && !bus) {
> +            usbDeviceList *devs = usbFindDevByVendor(vendor, product);
> +            if (!devs)
> +                goto cleanup;
> +
> +            if (usbDeviceListCount(devs) > 1) {
> +                qemuReportError(VIR_ERR_XML_ERROR,
> +                                _("multiple USB deivces %x:%x, "

s/deivces/devices/

-- 
Eric Blake   eblake at redhat.com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 620 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20120502/f4ad8c00/attachment-0001.sig>


More information about the libvir-list mailing list