Re: [PATCH] win-usb-dev: Set UsbDk backend on libusb 1.0.22

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

 



On Tue, Aug 14, 2018 at 09:03:30AM +0200, Jorge Olmos wrote:
> Hi,
> On Mon, 2018-08-13 at 17:25 +0200, Christophe Fergeau wrote:
> > Hey,
> > 
> > On Mon, Aug 13, 2018 at 03:45:06PM +0200, Jorge Olmos wrote:
> > > This patch configures libusb in the context used in win-usb-dev,
> > > with
> > > the same backend as the context initialized in usb-device-manager.
> > > 
> > > Otherwise spice_usb_device_manager_libdev_match returns false for
> > > all
> > > devices, and no usb device is offered to end user for redirection.
> > 
> > Upstream git already has this patch:
> > https://gitlab.freedesktop.org/spice/spice-gtk/commit/3e23fff91ea1542
> > 1a404fb8fc0cb5d86bfbeaa95
> > 
> > Christophe
> 
> That is not the same patch.
> 
> There are two calls to libusb_init() (in windows), each one with its
> own libusb_context, and each context has to be configured separately
> with a call to "libusb_set_option(context, LIBUSB_OPTION_USE_USBDK);"
> 
> - 3e23fff9 configures the context used in usb-device-manager.c
> - The patch I sent configures the context used in win-usb-dev.c

Ah right, I should have paid closer attention! So yes, the patch looks
good. My initial reaction was that it would be better to have a helper
doing the libusb_init() call for these 2 users, but I think Yuri is
working on some patches which will do that among other things, so
no need for that right now.

Acked-by: Christophe Fergeau <cfergeau@xxxxxxxxxx>

Christophe

> 
> 
> > > ---
> > >  src/win-usb-dev.c | 5 +++++
> > >  1 file changed, 5 insertions(+)
> > > 
> > > diff --git a/src/win-usb-dev.c b/src/win-usb-dev.c
> > > index 7dc02ac..9a130a3 100644
> > > --- a/src/win-usb-dev.c
> > > +++ b/src/win-usb-dev.c
> > > @@ -196,6 +196,11 @@ g_udev_client_initable_init(GInitable
> > > *initable, GCancellable *cancellable,
> > >                      "Error initializing USB support: %s [%i]",
> > > errstr, rc);
> > >          return FALSE;
> > >      }
> > > +#ifdef G_OS_WIN32
> > > +#if LIBUSB_API_VERSION >= 0x01000106
> > > +    libusb_set_option(priv->ctx, LIBUSB_OPTION_USE_USBDK);
> > > +#endif
> > > +#endif
> > >  
> > >      /* get initial device list */
> > >      if (g_udev_client_list_devices(self, &priv->udev_list, err,
> > > __FUNCTION__) < 0) {
> > > 
> > > --
> > > 
> > > _______________________________________________
> > > Spice-devel mailing list
> > > Spice-devel@xxxxxxxxxxxxxxxxxxxxx
> > > https://lists.freedesktop.org/mailman/listinfo/spice-devel
> -- 
> 
> 
> Jorge Olmos
> _______________________________________________
> Spice-devel mailing list
> Spice-devel@xxxxxxxxxxxxxxxxxxxxx
> https://lists.freedesktop.org/mailman/listinfo/spice-devel

Attachment: signature.asc
Description: PGP signature

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

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