mirror of
https://gitlab.uni-freiburg.de/opensourcevdi/spice-gtk
synced 2026-01-02 13:17:12 +00:00
win-usb-dev: compare vid:pid instead of bus.addr (Windows)
It seems that sometimes, on Win7 clients, bus.addr is changing when WinUSB driver is being installed (e.g. 4.1 -> 4.2). So compare vid:pid instead.
This commit is contained in:
parent
6a3206479f
commit
f9631cd6f8
@ -320,20 +320,20 @@ static gboolean get_usb_dev_info(libusb_device *dev, GUdevDeviceInfo *udevinfo)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/* Only bus,addr are compared */
|
||||
/* Only vid:pid are compared */
|
||||
static gboolean gudev_devices_are_equal(GUdevDevice *a, GUdevDevice *b)
|
||||
{
|
||||
GUdevDeviceInfo *ai, *bi;
|
||||
gboolean same_bus;
|
||||
gboolean same_addr;
|
||||
gboolean same_vid;
|
||||
gboolean same_pid;
|
||||
|
||||
ai = a->priv->udevinfo;
|
||||
bi = b->priv->udevinfo;
|
||||
|
||||
same_bus = (ai->bus == bi->bus);
|
||||
same_addr = (ai->addr == bi->addr);
|
||||
same_vid = (ai->vid == bi->vid);
|
||||
same_pid = (ai->pid == bi->pid);
|
||||
|
||||
return (same_bus && same_addr);
|
||||
return (same_pid && same_vid);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user