[Spice-devel] [spice-gtk Win32 v4 16/17] usb-device-manager: mingw: ignore "remove" udev event when un/installing a driver
Uri Lublin
uril at redhat.com
Thu Jul 5 13:44:08 PDT 2012
---
gtk/usb-device-manager.c | 11 ++++++++++-
1 files changed, 10 insertions(+), 1 deletions(-)
diff --git a/gtk/usb-device-manager.c b/gtk/usb-device-manager.c
index e032f24..3f0da77 100644
--- a/gtk/usb-device-manager.c
+++ b/gtk/usb-device-manager.c
@@ -718,6 +718,16 @@ static void spice_usb_device_manager_remove_dev(SpiceUsbDeviceManager *self,
return;
}
+#ifdef G_OS_WIN32
+ const guint8 state = spice_usb_device_get_state(device);
+ if ((state == SPICE_USB_DEVICE_STATE_INSTALLING) ||
+ (state == SPICE_USB_DEVICE_STATE_UNINSTALLING)) {
+ g_warning("skipping device at %d.%d. It is installing it's driver",
+ bus, address);
+ return;
+ }
+#endif
+
spice_usb_device_manager_disconnect_device(self, (SpiceUsbDevice *)device);
SPICE_DEBUG("device removed %p", device);
@@ -815,7 +825,6 @@ static void spice_usb_device_manager_drv_install_cb(GObject *gobject,
g_object_unref(installer);
- /* for only UN/INSTALL is of interest */
spice_usb_device_set_state(device, SPICE_USB_DEVICE_STATE_NONE);
if (err) {
--
1.7.7.6
More information about the Spice-devel
mailing list