[Spice-devel] [PATCH v4 01/16] UsbDeviceManager: Fix Windows build without USB redirection

Christophe Fergeau cfergeau at redhat.com
Tue Sep 22 08:42:32 PDT 2015


Maybe I applied these patches on top of a wrong commit, but I needed

diff --git a/src/usb-device-manager.c b/src/usb-device-manager.c
index e7da42e..ca8473f 100644
--- a/src/usb-device-manager.c
+++ b/src/usb-device-manager.c
@@ -1517,8 +1517,8 @@ void spice_usb_device_manager_connect_device_async(SpiceUsbDeviceManager *self,
                                              GAsyncReadyCallback callback,
                                              gpointer user_data)
 {
-    if (self->priv->use_usbclerk) {
 #if defined(USE_USBREDIR) && defined(G_OS_WIN32)
+    if (self->priv->use_usbclerk) {
         SpiceWinUsbDriver *installer;
         UsbInstallCbInfo *cbinfo;

@@ -1538,10 +1538,9 @@ void spice_usb_device_manager_connect_device_async(SpiceUsbDeviceManager *self,
         spice_win_usb_driver_install_async(installer, device, cancellable,
                                            spice_usb_device_manager_drv_install_cb,
                                            cbinfo);
-#else
-        g_assert_not_reached();
+    } else
 #endif
-    } else {
+    {
         _spice_usb_device_manager_connect_device_async(self,
                                                        device,
                                                        cancellable,

to be able to build with --disable-usbredir.
This could be squashed in the patches introducing use_usbclerk (or wherever
appropriate) as this hasn't been merged upstream yet.

Christophe

On Sun, Aug 16, 2015 at 03:35:38PM +0300, Dmitry Fleytman wrote:
> From: Kirill Moizik <kmoizik at redhat.com>
> 
> Signed-off-by: Kirill Moizik <kmoizik at redhat.com>
> Signed-off-by: Dmitry Fleytman <dfleytma at redhat.com>
> ---
>  src/usb-device-manager.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/src/usb-device-manager.c b/src/usb-device-manager.c
> index 5b8151f..e7da42e 100644
> --- a/src/usb-device-manager.c
> +++ b/src/usb-device-manager.c
> @@ -227,7 +227,7 @@ static void spice_usb_device_manager_init(SpiceUsbDeviceManager *self)
>      priv = SPICE_USB_DEVICE_MANAGER_GET_PRIVATE(self);
>      self->priv = priv;
>  
> -#ifdef G_OS_WIN32
> +#if defined(USE_USBREDIR) && defined(G_OS_WIN32)
>      priv->use_usbclerk = !usbdk_is_driver_installed();
>      if (!priv->use_usbclerk) {
>          if (usbdk_api_load(&priv->usbdk_api) != 0) {
> @@ -381,7 +381,7 @@ static void spice_usb_device_manager_finalize(GObject *gobject)
>      g_free(priv->auto_connect_filter);
>      g_free(priv->redirect_on_connect);
>  
> -#ifdef G_OS_WIN32
> +#if defined(USE_USBREDIR) && defined(G_OS_WIN32)
>      if (!priv->use_usbclerk) {
>          if (priv->usbdk_hider_handle != NULL) {
>              usbdk_clear_hide_rules(priv->usbdk_api, priv->usbdk_hider_handle);
> @@ -427,7 +427,7 @@ static void spice_usb_device_manager_get_property(GObject     *gobject,
>      }
>  }
>  
> -#ifdef G_OS_WIN32
> +#if defined(USE_USBREDIR) && defined(G_OS_WIN32)
>  static
>  void _usbdk_autoredir_enable(SpiceUsbDeviceManager *manager);
>  static
> @@ -448,7 +448,7 @@ static void spice_usb_device_manager_set_property(GObject       *gobject,
>          break;
>      case PROP_AUTO_CONNECT:
>          priv->auto_connect = g_value_get_boolean(value);
> -#ifdef G_OS_WIN32
> +#if defined(USE_USBREDIR) && defined(G_OS_WIN32)
>          if (!priv->use_usbclerk) {
>              if (priv->auto_connect) {
>                  _usbdk_autoredir_enable(self);
> -- 
> 2.4.3
> 
> _______________________________________________
> Spice-devel mailing list
> Spice-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/spice-devel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/spice-devel/attachments/20150922/c36abbba/attachment.sig>


More information about the Spice-devel mailing list