hw/usb/host-libusb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
From 6bfb3087866606ed36a21e7bd05f0674e6a97158 Mon Sep 17 00:00:00 2001
From: Bauerchen <bauerchen@tencent.com>
Date: Thu, 2 Apr 2020 19:19:00 +0800
Subject: [PATCH] Fix:fix the wrong function name of libusb_get_port_number
[desc]:
libusb_get_port_numbers is called in function
usb_host_get_port, and qemu crashed with:
symbol lookup error: undefined symbol: libusb_get_port_numbers
I check /lib64/libusb-1.0.so.0 and output is libusb_get_port_number, I
change it to libusb_get_port_number, crash problem is gone;
so is it just a function name bug?
Signed-off-by: Bauerchen <bauerchen@tencent.com>
---
hw/usb/host-libusb.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/usb/host-libusb.c b/hw/usb/host-libusb.c
index 2ac7a93..713db8d 100644
--- a/hw/usb/host-libusb.c
+++ b/hw/usb/host-libusb.c
@@ -285,7 +285,7 @@ static int usb_host_get_port(libusb_device *dev, char *port, size_t len)
int rc, i;
#if LIBUSB_API_VERSION >= 0x01000102
- rc = libusb_get_port_numbers(dev, path, 7);
+ rc = libusb_get_port_number(dev, path, 7);
#else
rc = libusb_get_port_path(ctx, dev, path, 7);
#endif
--
1.8.3.1
-------------
bauerchen
On Thu, Apr 02, 2020 at 11:47:17AM +0000, bauerchen(陈蒙蒙) wrote: > From 6bfb3087866606ed36a21e7bd05f0674e6a97158 Mon Sep 17 00:00:00 2001 > From: Bauerchen <bauerchen@tencent.com> > Date: Thu, 2 Apr 2020 19:19:00 +0800 > Subject: [PATCH] Fix:fix the wrong function name of libusb_get_port_number > > [desc]: > libusb_get_port_numbers is called in function > usb_host_get_port, and qemu crashed with: > symbol lookup error: undefined symbol: libusb_get_port_numbers > I check /lib64/libusb-1.0.so.0 and output is libusb_get_port_number, I > change it to libusb_get_port_number, crash problem is gone; > so is it just a function name bug? > > Signed-off-by: Bauerchen <bauerchen@tencent.com> > --- > hw/usb/host-libusb.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/hw/usb/host-libusb.c b/hw/usb/host-libusb.c > index 2ac7a93..713db8d 100644 > --- a/hw/usb/host-libusb.c > +++ b/hw/usb/host-libusb.c > @@ -285,7 +285,7 @@ static int usb_host_get_port(libusb_device *dev, char *port, size_t len) > int rc, i; > > #if LIBUSB_API_VERSION >= 0x01000102 > - rc = libusb_get_port_numbers(dev, path, 7); > + rc = libusb_get_port_number(dev, path, 7); Surely not that simple. libusb_get_port_number isn't a drop-in replacement for libusb_get_port_numbers. Also it was probably added later to libusb, so some LIBUSB_API_VERSION #ifdef will be needed so the one or the other will be used depending on the library version. cheers, Gerd
© 2016 - 2025 Red Hat, Inc.