mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-09-09 08:17:53 -06:00
usb: fix usb-host build on windows.
Seems the new API is not available on windows.
Update #ifdefs accordingly.
Fixes: 9f815e83e9
("usb: add hostdevice property to usb-host")
Reported-by: Howard Spoelstra <hsp.cat7@gmail.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Tested-by: Howard Spoelstra <hsp.cat7@gmail.com>
Message-id: 20200624134510.9381-1-kraxel@redhat.com
This commit is contained in:
parent
185951817d
commit
631009e775
1 changed files with 2 additions and 2 deletions
|
@ -907,7 +907,7 @@ static int usb_host_open(USBHostDevice *s, libusb_device *dev, int hostfd)
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
#if LIBUSB_API_VERSION >= 0x01000107
|
#if LIBUSB_API_VERSION >= 0x01000107 && !defined(CONFIG_WIN32)
|
||||||
trace_usb_host_open_hostfd(hostfd);
|
trace_usb_host_open_hostfd(hostfd);
|
||||||
|
|
||||||
rc = libusb_wrap_sys_device(ctx, hostfd, &s->dh);
|
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);
|
QTAILQ_INIT(&s->isorings);
|
||||||
s->hostfd = -1;
|
s->hostfd = -1;
|
||||||
|
|
||||||
#if LIBUSB_API_VERSION >= 0x01000107
|
#if LIBUSB_API_VERSION >= 0x01000107 && !defined(CONFIG_WIN32)
|
||||||
if (s->hostdevice) {
|
if (s->hostdevice) {
|
||||||
int fd;
|
int fd;
|
||||||
s->needs_autoscan = false;
|
s->needs_autoscan = false;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue