[Spice-devel] [PATCH v6 10/10] win-usbredir: Use UsbDk backend when available

Dmitry Fleytman dmitry at daynix.com
Thu Feb 11 14:24:04 UTC 2016


> On 5 Feb 2016, at 18:41 PM, Jonathon Jongsma <jjongsma at redhat.com> wrote:
> 
> On Thu, 2015-10-29 at 17:26 +0200, Dmitry Fleytman wrote:
>> Signed-off-by: Dmitry Fleytman <dmitry at daynix.com>
>> ---
>> src/usb-device-manager.c | 5 ++++-
>> 1 file changed, 4 insertions(+), 1 deletion(-)
>> 
>> diff --git a/src/usb-device-manager.c b/src/usb-device-manager.c
>> index 53820b4..f4e48eb 100644
>> --- a/src/usb-device-manager.c
>> +++ b/src/usb-device-manager.c
>> @@ -231,7 +231,8 @@ static void
>> spice_usb_device_manager_init(SpiceUsbDeviceManager *self)
>>     self->priv = priv;
>> 
>> #if defined(G_OS_WIN32) && defined(USE_USBREDIR)
>> -    priv->use_usbclerk = TRUE;
>> +    priv->use_usbclerk = !usbdk_is_driver_installed() ||
>> +                         !usbdk_api_load(&priv->usbdk_api);
> 
> as I just mentioned in another mail, the api needs to be loaded before it is
> used. So this patch will need to be re-ordered. 

See my explanation in reply on your comments for previous patches.
This is by design to make history more clear.

> 
>> #endif
>>     priv->channels = g_ptr_array_new();
>> #ifdef USE_USBREDIR
>> @@ -381,6 +382,8 @@ static void spice_usb_device_manager_finalize(GObject
>> *gobject)
>>     if (!priv->use_usbclerk) {
>>         if(priv->auto_connect)
>>             _usbdk_autoredir_disable(self);
>> +
>> +        usbdk_api_unload(priv->usbdk_api);
> 
> Since loading the API can fail, i think it would be better to check if priv
> ->usbdk_api is non-NULL before unloading it. 

I fixed this in usbdk_api_unload(). Thanks.

> 
>>     }
>> #endif
>>     /* Chain up to the parent class */
> 
> Reviewed-by: Jonathon Jongsma <jjongsma at redhat.com <mailto:jjongsma at redhat.com>>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/spice-devel/attachments/20160211/f8026926/attachment.html>


More information about the Spice-devel mailing list