Re: [PATCH v4 05/16] UsbDeviceManager: move existing code to a separate function

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Aug 16, 2015 at 03:35:42PM +0300, Dmitry Fleytman wrote:
> From: Kirill Moizik <kmoizik@xxxxxxxxxx>
> 
> Signed-off-by: Kirill Moizik <kmoizik@xxxxxxxxxx>
> Signed-off-by: Dmitry Fleytman <dfleytma@xxxxxxxxxx>
> ---
>  src/usb-device-manager.c | 58 +++++++++++++++++++++++++++---------------------
>  1 file changed, 33 insertions(+), 25 deletions(-)
> 
> diff --git a/src/usb-device-manager.c b/src/usb-device-manager.c
> index e7da42e..58e4042 100644
> --- a/src/usb-device-manager.c
> +++ b/src/usb-device-manager.c
> @@ -1201,6 +1201,37 @@ static void spice_usb_device_manager_drv_uninstall_cb(GObject *gobject,
>  
>  #endif
>  
> +#if defined(USE_USBREDIR) && defined(G_OS_WIN32)
> +void  spice_usb_device_manager_driver_uninstall_async(SpiceUsbDeviceManager *self,
> +                                                      SpiceUsbDevice *device)
> +{
> +
> +    SpiceWinUsbDriver *installer;
> +    UsbInstallCbInfo *cbinfo;
> +    guint8 state;
> +
> +    g_warn_if_fail(device != NULL);
> +    g_return_if_fail(self->priv->installer);
> +
> +    state = spice_usb_device_get_state(device);
> +    if ((state != SPICE_USB_DEVICE_STATE_INSTALLED) &&
> +        (state != SPICE_USB_DEVICE_STATE_CONNECTED)) {
> +        return;
> +    }
> +
> +    spice_usb_device_set_state(device, SPICE_USB_DEVICE_STATE_UNINSTALLING);
> +
> +    installer = self->priv->installer;
> +    cbinfo = g_new0(UsbInstallCbInfo, 1);
> +    cbinfo->manager     = self;
> +    cbinfo->device      = spice_usb_device_ref(device);
> +    cbinfo->installer   = installer;
> +    spice_win_usb_driver_uninstall_async (installer, device, NULL,
> +                                          spice_usb_device_manager_drv_uninstall_cb,
> +                                          cbinfo);
> +}
> +#endif
> +
>  /* ------------------------------------------------------------------ */
>  /* private api                                                        */
>  
> @@ -1588,31 +1619,8 @@ void spice_usb_device_manager_disconnect_device(SpiceUsbDeviceManager *self,
>          spice_usbredir_channel_disconnect_device(channel);
>  
>  #ifdef G_OS_WIN32
> -   if (self->priv->use_usbclerk) {
> -        SpiceWinUsbDriver *installer;
> -        UsbInstallCbInfo *cbinfo;
> -        guint8 state;
> -
> -        g_warn_if_fail(device != NULL);
> -        g_return_if_fail(self->priv->installer);
> -
> -        state = spice_usb_device_get_state(device);
> -        if ((state != SPICE_USB_DEVICE_STATE_INSTALLED) &&
> -           (state != SPICE_USB_DEVICE_STATE_CONNECTED)) {
> -           return;
> -        }
> -
> -        spice_usb_device_set_state(device, SPICE_USB_DEVICE_STATE_UNINSTALLING);
> -
> -        installer = self->priv->installer;
> -        cbinfo = g_new0(UsbInstallCbInfo, 1);
> -        cbinfo->manager     = self;
> -        cbinfo->device      = spice_usb_device_ref(device);
> -        cbinfo->installer   = installer;
> -
> -        spice_win_usb_driver_uninstall_async (installer, device, NULL,
> -                                       spice_usb_device_manager_drv_uninstall_cb,
> -                                       cbinfo);
> +    if (self->priv->use_usbclerk) {
> +        spice_usb_device_manager_driver_uninstall_async(self,device);

Missing space before 'device'

>      }
>  #endif
>  
> -- 
> 2.4.3
> 
> _______________________________________________
> Spice-devel mailing list
> Spice-devel@xxxxxxxxxxxxxxxxxxxxx
> http://lists.freedesktop.org/mailman/listinfo/spice-devel

Attachment: pgpnq6balxIJK.pgp
Description: PGP signature

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/spice-devel

[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]