qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: kraxel <kraxel@redhat.com>
To: "bauerchen(陈蒙蒙)" <bauerchen@tencent.com>
Cc: hdegoede <hdegoede@redhat.com>, qemu-devel <qemu-devel@nongnu.org>
Subject: Re: is just a wrong function name of libusb_get_port_number? request for a review of the bug fix
Date: Fri, 3 Apr 2020 08:50:42 +0200	[thread overview]
Message-ID: <20200403065042.cirj4ih3fl45wlqb@sirius.home.kraxel.org> (raw)
In-Reply-To: <02a07a59c3964199b73b1145e4abe0e9@tencent.com>

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



  reply	other threads:[~2020-04-03  6:52 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-02 11:47 is just a wrong function name of libusb_get_port_number? request for a review of the bug fix bauerchen(陈蒙蒙)
2020-04-03  6:50 ` kraxel [this message]
2020-04-03  7:05   ` Re: is just a wrong function name of libusb_get_port_number? request for a review of the bug fix(Internet mail) bauerchen(陈蒙蒙)
2020-04-03  8:19     ` kraxel
2020-04-03  8:50       ` bauerchen(陈蒙蒙)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200403065042.cirj4ih3fl45wlqb@sirius.home.kraxel.org \
    --to=kraxel@redhat.com \
    --cc=bauerchen@tencent.com \
    --cc=hdegoede@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).