diff mbox series

[PULL,2/5] usb-host: reset and close libusb_device_handle before qemu exit

Message ID 20181214103854.13820-3-kraxel@redhat.com
State New
Headers show
Series [PULL,1/5] pvusb: set max grants only in initialise | expand

Commit Message

Gerd Hoffmann Dec. 14, 2018, 10:38 a.m. UTC
From: linzhecheng <linzhecheng@huawei.com>

we should perform these things as same as usb_host_close.

Signed-off-by: linzhecheng <linzhecheng@huawei.com>
Message-id: 20181130064700.5984-1-linzhecheng@huawei.com

[ kraxel: whitespace fixup ]

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 hw/usb/host-libusb.c | 2 ++
 1 file changed, 2 insertions(+)
diff mbox series

Patch

diff --git a/hw/usb/host-libusb.c b/hw/usb/host-libusb.c
index b6602ded4e..833250a886 100644
--- a/hw/usb/host-libusb.c
+++ b/hw/usb/host-libusb.c
@@ -988,7 +988,9 @@  static void usb_host_exit_notifier(struct Notifier *n, void *data)
 
     if (s->dh) {
         usb_host_release_interfaces(s);
+        libusb_reset_device(s->dh);
         usb_host_attach_kernel(s);
+        libusb_close(s->dh);
     }
 }