[Spice-devel] [spice-gtk PATCH 0/9] Windows: identify USB devices by vid:pid instead of bus.address

Hans de Goede hdegoede at redhat.com
Wed Mar 27 09:49:51 PDT 2013


Hi,

As discussed as a solution for this *for now*, this series looks good, ACK series.

One remark, which can be fixed with an add on patch, or added to patch 9,
around line 734 (in unpatches sources), in spice_usb_device_manager_add_dev,
there is:

     if (!device) {
         g_warning("Could not find USB device to add at busnum %d devaddr %d",
                   bus, address);
         return;
     }

This should be modified to use DEV_ID_FMT too.

Regards,

Hans


On 03/25/2013 11:01 AM, Uri Lublin wrote:
> rhbz#842816
>
> It seems that sometimes a USB device's bus.address is changing after
> installation of WinUSB driver for that device.
> So instead use vid:pid which are consistent across driver installation.
>
> The switch to using vid:pid is done in patch 8/9.
>
> Some code reuses variables named "bus" and "address" to hold vid and pid
> values. If people think this should be changed to new variables names (ifdefed)
> and/or new function instead of spice_usb_device_manager_get_udev_bus_n_address
> let me know.
>
> Using two devices with the same vid:pid on the same Windows client is already
> not supported, since Windows installs USB drivers for specific devices
> based on their vid:pid
>
> Uri Lublin (9):
>    win-usb-dev: make VID and PID available via get_property (Windows)
>    win-usb-dev: compare vid:pid instead of bus.addr (Windows)
>    usb-device-manager: constify spice_usb_device_get_ functions
>    usb-device-manager: find_device: use a match function
>    usb-device-manager: find_libdev: use a match function
>    usb-device-manager: use a function to get vid:pid from a libusb_device
>    usb-device-manager: Windows: spice_usb_device_equal_libdev: compare vid:pid
>    usb-device-manager: Windows: identify devices by vid:pid instead of bus.address
>    usb-device-manager: fix log messages to match vid:pid change
>
>   gtk/usb-device-manager-priv.h |   8 +-
>   gtk/usb-device-manager.c      | 173 +++++++++++++++++++++++++++++++++++-------
>   gtk/win-usb-dev.c             |  20 +++--
>   3 files changed, 162 insertions(+), 39 deletions(-)
>


More information about the Spice-devel mailing list