aboutsummaryrefslogtreecommitdiff
path: root/hw/usb
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2017-05-23 10:46:35 +0200
committerGerd Hoffmann <kraxel@redhat.com>2017-05-29 14:18:09 +0200
commit26022652c6fd067b9fa09280f5a6d6284a21c73f (patch)
tree080401ceedb8c53fd3b92905fd235af0ab6e819f /hw/usb
parent6361bbc7e21f822823e015e5ccb50d4ac1745b1b (diff)
downloadqemu-26022652c6fd067b9fa09280f5a6d6284a21c73f.zip
qemu-26022652c6fd067b9fa09280f5a6d6284a21c73f.tar.gz
qemu-26022652c6fd067b9fa09280f5a6d6284a21c73f.tar.bz2
usb: don't wakeup during coldplug
Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1452512 Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Message-id: 20170523084635.20062-1-kraxel@redhat.com
Diffstat (limited to 'hw/usb')
-rw-r--r--hw/usb/core.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/hw/usb/core.c b/hw/usb/core.c
index 45fa00c..241ae66 100644
--- a/hw/usb/core.c
+++ b/hw/usb/core.c
@@ -98,6 +98,14 @@ void usb_wakeup(USBEndpoint *ep, unsigned int stream)
USBDevice *dev = ep->dev;
USBBus *bus = usb_bus_from_device(dev);
+ if (!qdev_hotplug) {
+ /*
+ * This is machine init cold plug. No need to wakeup anyone,
+ * all devices will be reset anyway. And trying to wakeup can
+ * cause problems due to hitting uninitialized devices.
+ */
+ return;
+ }
if (dev->remote_wakeup && dev->port && dev->port->ops->wakeup) {
dev->port->ops->wakeup(dev->port);
}