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

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

 



On 05/03/2012 01:29 AM, Eric Blake wrote:
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.

    Bus number start with 1,
"
    # ls /sys/bus/usb/devices/
       1-0:1.0 1-1.3 1-1.3.1:1.0 1-1:1.0 1-1 1-1.3.1 1-1.3:1.0 usb1

    The names that begin with "usb" refer to USB controllers.
More accurately, they refer to the "root hub" associated with each controller. The number is the USB bus number. In the example there is only one controller,
    so its bus is number 1. Hence the name "usb1"
"

    http://www.linux-usb.org/FAQ.html#ts5


If bus is specified, bus should be greater than zero( it will be ignored to specify zero)
    if not specified,  usbFindDevByVendor is invoked to get device.



+        } 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/


--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]