[Spice-commits] src/usb-device-manager.c

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Aug 9 11:50:39 UTC 2018


 src/usb-device-manager.c |    6 ++++++
 1 file changed, 6 insertions(+)

New commits:
commit 3e23fff91ea15421a404fb8fc0cb5d86bfbeaa95
Author: 王凡 <wangfan1987.good at 163.com>
Date:   Tue Aug 7 10:06:18 2018 +0200

    usb-device-manager: Set UsbDk backend on libusb 1.0.22
    
    In libusb 1.0.21, UsbDk is enabled at compile time with --enable-usbdk
    option. In libusb 1.0.22, the backend is selected at runtime.
    
    This patch avoids a crash when spice client is compiled against libusb
    1.0.22 and UsbDk is not installed.
    
    * Enabling dynamic backend selection in Windows
    https://github.com/libusb/libusb/commit/54884e84d024e761450287ab56aca
    
    https://gitlab.freedesktop.org/spice/spice-gtk/issues/74
    Signed-off-by: Victor Toso <victortoso at redhat.com>
    Acked-by: Christophe Fergeau <cfergeau at redhat.com>

diff --git a/src/usb-device-manager.c b/src/usb-device-manager.c
index 55bf67e..50fb491 100644
--- a/src/usb-device-manager.c
+++ b/src/usb-device-manager.c
@@ -303,6 +303,12 @@ static gboolean spice_usb_device_manager_initable_init(GInitable  *initable,
         return FALSE;
     }
 
+#ifdef G_OS_WIN32
+#if LIBUSB_API_VERSION >= 0x01000106
+    libusb_set_option(priv->context, LIBUSB_OPTION_USE_USBDK);
+#endif
+#endif
+
     /* Start listening for usb devices plug / unplug */
 #ifdef USE_GUDEV
     priv->udev = g_udev_client_new(subsystems);


More information about the Spice-commits mailing list