]> git.proxmox.com Git - mirror_qemu.git/commitdiff
xhci: fix port status
authorGerd Hoffmann <kraxel@redhat.com>
Thu, 1 Mar 2012 14:14:12 +0000 (15:14 +0100)
committerGerd Hoffmann <kraxel@redhat.com>
Wed, 7 Mar 2012 11:28:05 +0000 (12:28 +0100)
Don't signal port status change if the usb device isn't in attached
state.  Happens with usb-host devices with the pass-through device
being plugged out at the host.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
hw/usb-xhci.c

index 83054896a62a7b97c8d506fce9ed3e294ed5f1a9..e8f1b6e3a5c76405e460e8f1447698aa13f73980 100644 (file)
@@ -2279,7 +2279,7 @@ static void xhci_update_port(XHCIState *xhci, XHCIPort *port, int is_detach)
     int nr = port->port.index + 1;
 
     port->portsc = PORTSC_PP;
-    if (port->port.dev && !is_detach) {
+    if (port->port.dev && port->port.dev->attached && !is_detach) {
         port->portsc |= PORTSC_CCS;
         switch (port->port.dev->speed) {
         case USB_SPEED_LOW: