Re: [PATCH usbredirserver] Fix libusb-1.0.22 deprecated libusb_set_debug

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

 



And pushed as
https://gitlab.freedesktop.org/spice/usbredir/commit/50cfb1af86d031d25bd2685234e9128807638a0d

On Thu, Aug 02, 2018 at 09:23:36AM -0500, Jonathon Jongsma wrote:
> Looks fine.
> 
> Acked-by: Jonathon Jongsma <jjongsma@xxxxxxxxxx> 
> 
> 
> On Thu, 2018-08-02 at 15:24 +0800, Han Han wrote:
> > Since libusb-1.0.22, libusb_set_debug is deprecated and replaced with
> > libusb_set_option.
> > 
> > Details:
> > https://github.com/libusb/libusb/commit/539f22e2fd916558d11ab9a66f10f
> > 461c5593168
> > 
> > Compiling error:
> > usbredirhost.c: In function ‘usbredirhost_open_full’:
> > usbredirhost.c:753:5: error: ‘libusb_set_debug’ is deprecated: Use
> > libusb_set_option instead [-Werror=deprecated-declarations]
> >      libusb_set_debug(host->ctx, host->verbose);
> >      ^~~~~~~~~~~~~~~~
> > 
> > Signed-off-by: Han Han <hhan@xxxxxxxxxx>
> > ---
> >  usbredirhost/usbredirhost.c     | 4 ++++
> >  usbredirserver/usbredirserver.c | 4 ++++
> >  2 files changed, 8 insertions(+)
> > 
> > diff --git a/usbredirhost/usbredirhost.c
> > b/usbredirhost/usbredirhost.c
> > index 3666227..d55cd5c 100644
> > --- a/usbredirhost/usbredirhost.c
> > +++ b/usbredirhost/usbredirhost.c
> > @@ -750,7 +750,11 @@ struct usbredirhost *usbredirhost_open_full(
> >      usbredirparser_init(host->parser, version, caps,
> > USB_REDIR_CAPS_SIZE,
> >                          parser_flags);
> >  
> > +#if LIBUSB_API_VERSION >= 0x01000106
> > +    libusb_set_option(host->ctx, LIBUSB_OPTION_LOG_LEVEL, host-
> > >verbose);
> > +#else
> >      libusb_set_debug(host->ctx, host->verbose);
> > +#endif
> >  
> >      if (usbredirhost_set_device(host, usb_dev_handle) !=
> > usb_redir_success) {
> >          usbredirhost_close(host);
> > diff --git a/usbredirserver/usbredirserver.c
> > b/usbredirserver/usbredirserver.c
> > index 849aa05..6aa2740 100644
> > --- a/usbredirserver/usbredirserver.c
> > +++ b/usbredirserver/usbredirserver.c
> > @@ -297,7 +297,11 @@ int main(int argc, char *argv[])
> >          exit(1);
> >      }
> >  
> > +#if LIBUSB_API_VERSION >= 0x01000106
> > +    libusb_set_option(ctx, LIBUSB_OPTION_LOG_LEVEL, verbose);
> > +#else
> >      libusb_set_debug(ctx, verbose);
> > +#endif
> >  
> >      if (ipv4_addr) {
> >          server_fd = socket(AF_INET, SOCK_STREAM, 0);
> _______________________________________________
> 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]