From fff6003430289162b86d378be2eb0fdd1f895a91 Mon Sep 17 00:00:00 2001
From: Gerd Hoffmann <kraxel@redhat.com>
Date: Thu, 23 Jun 2011 12:40:39 -0300
Subject: [RHEL6 qemu-kvm PATCH 006/115] Return usb device to host on usb_del command

RH-Author: Gerd Hoffmann <kraxel@redhat.com>
Message-id: <1308832951-8995-4-git-send-email-kraxel@redhat.com>
Patchwork-id: 27851
O-Subject: [RHEL-6.2 kvm PATCH 003/115] Return usb device to host on usb_del command
Bugzilla: 561414 632299 645351 711354
RH-Acked-by: Hans de Goede <hdegoede@redhat.com>
RH-Acked-by: Jes Sorensen <Jes.Sorensen@redhat.com>
RH-Acked-by: Paolo Bonzini <pbonzini@redhat.com>
RH-Acked-by: Kevin Wolf <kwolf@redhat.com>

From: Shahar Havivi <shaharh@redhat.com>

Signed-off-by: Shahar Havivi <shaharh@redhat.com>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
(cherry picked from commit 00ff227a328f02cdb0913c51bc46457c50351c79)
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 usb-linux.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
 usb-linux.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/usb-linux.c b/usb-linux.c
index fe59378..41e2c3a 100644
--- a/usb-linux.c
+++ b/usb-linux.c
@@ -962,6 +962,7 @@ static int usb_host_close(USBHostDevice *dev)
     async_complete(dev);
     dev->closing = 0;
     usb_device_detach(&dev->dev);
+    ioctl(dev->fd, USBDEVFS_RESET);
     close(dev->fd);
     dev->fd = -1;
     return 0;
-- 
1.7.3.2

