summary refs log tree commit diff stats
path: root/hw/usb/host-libusb.c
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2019-05-22 11:47:01 +0200
committerGerd Hoffmann <kraxel@redhat.com>2019-05-29 07:03:56 +0200
commit65f14ab98da1da920f98ee8734dc1588b01d6b2b (patch)
tree654cc486a7ff5f93a0e132b5c10dc9e7cd956ac3 /hw/usb/host-libusb.c
parent7ed4657396add28382081a15557c78cd480c1cf1 (diff)
downloadfocaccia-qemu-65f14ab98da1da920f98ee8734dc1588b01d6b2b.tar.gz
focaccia-qemu-65f14ab98da1da920f98ee8734dc1588b01d6b2b.zip
usb-host: skip reset for untouched devices
If the guest didn't talk to the device yet, skip the reset.
Without this usb-host devices get resetted a number of times
at boot time for no good reason.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Message-id: 20190522094702.17619-3-kraxel@redhat.com
Diffstat (limited to 'hw/usb/host-libusb.c')
-rw-r--r--hw/usb/host-libusb.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/hw/usb/host-libusb.c b/hw/usb/host-libusb.c
index 67b7465915..4e9a45a5d2 100644
--- a/hw/usb/host-libusb.c
+++ b/hw/usb/host-libusb.c
@@ -1459,6 +1459,9 @@ static void usb_host_handle_reset(USBDevice *udev)
     if (!s->allow_guest_reset) {
         return;
     }
+    if (udev->addr == 0) {
+        return;
+    }
 
     trace_usb_host_reset(s->bus_num, s->addr);