From 873c4715b807f0ed2d3648357bfa1804f4a0eea2 Mon Sep 17 00:00:00 2001
From: Gerd Hoffmann <kraxel@redhat.com>
Date: Thu, 15 Dec 2011 10:39:52 +0100
Subject: [PATCH 2/2] usb-hub: wakeup on detach too.

RH-Author: Gerd Hoffmann <kraxel@redhat.com>
Message-id: <1323945593-30851-2-git-send-email-kraxel@redhat.com>
Patchwork-id: 35825
O-Subject: [RHEL-6.3 qemu-kvm PATCH 1/2] usb-hub: wakeup on detach too.
Bugzilla: 767499
RH-Acked-by: Paolo Bonzini <pbonzini@redhat.com>
RH-Acked-by: Kevin Wolf <kwolf@redhat.com>
RH-Acked-by: Markus Armbruster <armbru@redhat.com>

When detaching devices from the usb hub we must wakeup too,
otherwise the host misses the detach event.

Commit 4a33a9ea06f6fbb08d8311a7cfed72975344f9ab does the
same for device attach.

Found by hkran@linux.vnet.ibm.com

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
(cherry picked from commit be35cbbc8802eeba750c300c35339d69929989a6)
---
 hw/usb-hub.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

Signed-off-by: Michal Novotny <minovotn@redhat.com>
---
 hw/usb-hub.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/hw/usb-hub.c b/hw/usb-hub.c
index 94880b5..7fbb78c 100644
--- a/hw/usb-hub.c
+++ b/hw/usb-hub.c
@@ -171,6 +171,8 @@ static void usb_hub_detach(USBPort *port1)
     USBHubState *s = port1->opaque;
     USBHubPort *port = &s->ports[port1->index];
 
+    usb_wakeup(&s->dev);
+
     /* Let upstream know the device on this port is gone */
     s->dev.port->ops->child_detach(s->dev.port, port1->dev);
 
-- 
1.7.7.4

