qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH v2] usb-host: reset and close libusb_device_handle before qemu exit
@ 2018-12-11  1:06 linzhecheng
  0 siblings, 0 replies; only message in thread
From: linzhecheng @ 2018-12-11  1:06 UTC (permalink / raw)
  To: qemu-devel; +Cc: kraxel, jianjay.zhou, linzhecheng

we should perform these actions as same as usb_host_close.

Signed-off-by: linzhecheng <linzhecheng@huawei.com>

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);
     }
 }
 
-- 
2.12.2.windows.2

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2018-12-11  1:07 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-12-11  1:06 [Qemu-devel] [PATCH v2] usb-host: reset and close libusb_device_handle before qemu exit linzhecheng

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).