[Spice-devel] [PATCH] win: usb: use port_number instead of device_address

Uri Lublin uril at redhat.com
Wed Mar 6 15:27:57 PST 2013


It seems that device_address is not consistent and port_number is for Windows.
For example the device_address may change when the WinUSB driver is
installed.
This seems to happen more for Win7 clients.

USB devices are being redir'ed by their bus_number and device_address.
When the device_address before/after installing the WinUSB driver is not
the same, the "before" device will not be found, and an error message
will appear. The "after" device may or may not be redir'ed.

Note that win-usb-dev.h is compiled only for Windows machine.

Fixes rhbz#842816
---

1. Although a bit hacky and maybe confusing, this patch is least intrusive,
and does not require ifdefs etc.
If you think it's too much, please let me know and I'll make another patch.
One thing I thought of is to redir based on vid:pid instead of bus.addr for windows clients.

2. I did not reproduced the bug exactly as explained in its description.

---
 gtk/win-usb-dev.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/gtk/win-usb-dev.h b/gtk/win-usb-dev.h
index b5c4fce..5cd6ef5 100644
--- a/gtk/win-usb-dev.h
+++ b/gtk/win-usb-dev.h
@@ -107,4 +107,5 @@ typedef enum

 G_END_DECLS

+#define libusb_get_device_address(dev) libusb_get_port_number(dev)
 #endif /* __WIN_USB_DEV_H__ */
-- 
1.8.1.4



More information about the Spice-devel mailing list