From e1ceffd58a4fc842c2a31c977c24e3ac0ced42a5 Mon Sep 17 00:00:00 2001 From: Gerd Hoffmann Date: Tue, 4 Jun 2019 05:12:45 +0100 Subject: [PATCH 3/5] usb-host: skip reset for untouched devices MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit RH-Author: Gerd Hoffmann Message-id: <20190604051246.11374-4-kraxel@redhat.com> Patchwork-id: 88474 O-Subject: [RHEL-8.1.0 qemu-kvm PATCH 3/4] usb-host: skip reset for untouched devices Bugzilla: 1719228 RH-Acked-by: Dr. David Alan Gilbert RH-Acked-by: Philippe Mathieu-Daudé RH-Acked-by: Max Reitz 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 Message-id: 20190522094702.17619-3-kraxel@redhat.com (cherry picked from commit 65f14ab98da1da920f98ee8734dc1588b01d6b2b) Signed-off-by: Danilo C. L. de Paula --- hw/usb/host-libusb.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hw/usb/host-libusb.c b/hw/usb/host-libusb.c index d82a10a..dd3ed02 100644 --- a/hw/usb/host-libusb.c +++ b/hw/usb/host-libusb.c @@ -1454,6 +1454,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); -- 1.8.3.1