qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] usb: fix usb-host build on windows.
@ 2020-06-24 13:45 Gerd Hoffmann
  2020-06-24 15:19 ` Howard Spoelstra
  2020-06-24 16:14 ` Philippe Mathieu-Daudé
  0 siblings, 2 replies; 3+ messages in thread
From: Gerd Hoffmann @ 2020-06-24 13:45 UTC (permalink / raw)
  To: qemu-devel; +Cc: Gerd Hoffmann, Howard Spoelstra

Seems the new API is not available on windows.
Update #ifdefs accordingly.

Fixes: 9f815e83e983 ("usb: add hostdevice property to usb-host")
Reported-by: Howard Spoelstra <hsp.cat7@gmail.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 hw/usb/host-libusb.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/hw/usb/host-libusb.c b/hw/usb/host-libusb.c
index ad7ed8fb0c67..c474551d8456 100644
--- a/hw/usb/host-libusb.c
+++ b/hw/usb/host-libusb.c
@@ -907,7 +907,7 @@ static int usb_host_open(USBHostDevice *s, libusb_device *dev, int hostfd)
             goto fail;
         }
     } else {
-#if LIBUSB_API_VERSION >= 0x01000107
+#if LIBUSB_API_VERSION >= 0x01000107 && !defined(CONFIG_WIN32)
         trace_usb_host_open_hostfd(hostfd);
 
         rc = libusb_wrap_sys_device(ctx, hostfd, &s->dh);
@@ -1107,7 +1107,7 @@ static void usb_host_realize(USBDevice *udev, Error **errp)
     QTAILQ_INIT(&s->isorings);
     s->hostfd = -1;
 
-#if LIBUSB_API_VERSION >= 0x01000107
+#if LIBUSB_API_VERSION >= 0x01000107 && !defined(CONFIG_WIN32)
     if (s->hostdevice) {
         int fd;
         s->needs_autoscan = false;
-- 
2.18.4



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] usb: fix usb-host build on windows.
  2020-06-24 13:45 [PATCH] usb: fix usb-host build on windows Gerd Hoffmann
@ 2020-06-24 15:19 ` Howard Spoelstra
  2020-06-24 16:14 ` Philippe Mathieu-Daudé
  1 sibling, 0 replies; 3+ messages in thread
From: Howard Spoelstra @ 2020-06-24 15:19 UTC (permalink / raw)
  To: Gerd Hoffmann; +Cc: qemu-devel qemu-devel

[-- Attachment #1: Type: text/plain, Size: 1381 bytes --]

On Wed, Jun 24, 2020 at 3:45 PM Gerd Hoffmann <kraxel@redhat.com> wrote:

> Seems the new API is not available on windows.
> Update #ifdefs accordingly.
>
> Fixes: 9f815e83e983 ("usb: add hostdevice property to usb-host")
> Reported-by: Howard Spoelstra <hsp.cat7@gmail.com>
> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
> ---
>  hw/usb/host-libusb.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/hw/usb/host-libusb.c b/hw/usb/host-libusb.c
> index ad7ed8fb0c67..c474551d8456 100644
> --- a/hw/usb/host-libusb.c
> +++ b/hw/usb/host-libusb.c
> @@ -907,7 +907,7 @@ static int usb_host_open(USBHostDevice *s,
> libusb_device *dev, int hostfd)
>              goto fail;
>          }
>      } else {
> -#if LIBUSB_API_VERSION >= 0x01000107
> +#if LIBUSB_API_VERSION >= 0x01000107 && !defined(CONFIG_WIN32)
>          trace_usb_host_open_hostfd(hostfd);
>
>          rc = libusb_wrap_sys_device(ctx, hostfd, &s->dh);
> @@ -1107,7 +1107,7 @@ static void usb_host_realize(USBDevice *udev, Error
> **errp)
>      QTAILQ_INIT(&s->isorings);
>      s->hostfd = -1;
>
> -#if LIBUSB_API_VERSION >= 0x01000107
> +#if LIBUSB_API_VERSION >= 0x01000107 && !defined(CONFIG_WIN32)
>      if (s->hostdevice) {
>          int fd;
>          s->needs_autoscan = false;
> --
> 2.18.4
>
> Thanks for the quick fix, so:

Tested-by: Howard Spoelstra <hsp.cat7@gmail.com>

[-- Attachment #2: Type: text/html, Size: 2070 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] usb: fix usb-host build on windows.
  2020-06-24 13:45 [PATCH] usb: fix usb-host build on windows Gerd Hoffmann
  2020-06-24 15:19 ` Howard Spoelstra
@ 2020-06-24 16:14 ` Philippe Mathieu-Daudé
  1 sibling, 0 replies; 3+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-06-24 16:14 UTC (permalink / raw)
  To: Gerd Hoffmann, qemu-devel; +Cc: Howard Spoelstra

On 6/24/20 3:45 PM, Gerd Hoffmann wrote:
> Seems the new API is not available on windows.
> Update #ifdefs accordingly.
> 
> Fixes: 9f815e83e983 ("usb: add hostdevice property to usb-host")
> Reported-by: Howard Spoelstra <hsp.cat7@gmail.com>
> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
> ---
>  hw/usb/host-libusb.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/hw/usb/host-libusb.c b/hw/usb/host-libusb.c
> index ad7ed8fb0c67..c474551d8456 100644
> --- a/hw/usb/host-libusb.c
> +++ b/hw/usb/host-libusb.c
> @@ -907,7 +907,7 @@ static int usb_host_open(USBHostDevice *s, libusb_device *dev, int hostfd)
>              goto fail;
>          }
>      } else {
> -#if LIBUSB_API_VERSION >= 0x01000107
> +#if LIBUSB_API_VERSION >= 0x01000107 && !defined(CONFIG_WIN32)
>          trace_usb_host_open_hostfd(hostfd);
>  
>          rc = libusb_wrap_sys_device(ctx, hostfd, &s->dh);
> @@ -1107,7 +1107,7 @@ static void usb_host_realize(USBDevice *udev, Error **errp)
>      QTAILQ_INIT(&s->isorings);
>      s->hostfd = -1;
>  
> -#if LIBUSB_API_VERSION >= 0x01000107
> +#if LIBUSB_API_VERSION >= 0x01000107 && !defined(CONFIG_WIN32)
>      if (s->hostdevice) {
>          int fd;
>          s->needs_autoscan = false;
> 

Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-06-24 16:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-06-24 13:45 [PATCH] usb: fix usb-host build on windows Gerd Hoffmann
2020-06-24 15:19 ` Howard Spoelstra
2020-06-24 16:14 ` Philippe Mathieu-Daudé

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).