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

Submitted by Uri Lublin on July 9, 2012, 12:14 p.m.

Details

Message ID d4e5f2a387b87167c447c86454b61ccfa6ba9e85.1341834461.git.uril@redhat.com
State New
Headers show

Not browsing as part of any series.

Commit Message

Uri Lublin July 9, 2012, 12:14 p.m.
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(-)

Patch hide | download patch | download mbox

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

Comments

On Mon, Jul 9, 2012 at 2:14 PM, Uri Lublin <uril@redhat.com> wrote:
> +        g_warning("USB device at %d.%d already exists", bus, address);

If it's an expected and repeatable event that is normal to ignore,
please turn this into SPICE_DEBUG.

ack anyway

regards