[Spice-devel] [spice-gtk Win32 v5 11/22] usb-device-manager: mingw: add_dev: ignore already known devices

Uri Lublin uril at redhat.com
Mon Jul 9 05:14:54 PDT 2012


Sometimes on a Windows client, udev events are received while
the driver is being un/installed. so just ignore it
---
 gtk/usb-device-manager.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/gtk/usb-device-manager.c b/gtk/usb-device-manager.c
index ffddb3b..f77d09a 100644
--- a/gtk/usb-device-manager.c
+++ b/gtk/usb-device-manager.c
@@ -580,6 +580,14 @@ static void spice_usb_device_manager_add_dev(SpiceUsbDeviceManager  *self,
         return;
     }
 
+#ifdef G_OS_WIN32
+    device = spice_usb_device_manager_find_device(self, bus, address);
+    if (device) {
+        g_warning("USB device at %d.%d already exists", bus, address);
+        return;
+    }
+#endif
+
     if (priv->coldplug_list)
         dev_list = priv->coldplug_list;
     else
-- 
1.7.1



More information about the Spice-devel mailing list