From: linzhecheng <linzhecheng@huawei.com>
To: qemu-devel@nongnu.org
Cc: kraxel@redhat.com, jianjay.zhou@huawei.com,
linzhecheng <linzhecheng@huawei.com>
Subject: [Qemu-devel] [PATCH v2] usb-host: reset and close libusb_device_handle before qemu exit
Date: Tue, 11 Dec 2018 09:06:56 +0800 [thread overview]
Message-ID: <20181211010656.704-1-linzhecheng@huawei.com> (raw)
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
reply other threads:[~2018-12-11 1:07 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20181211010656.704-1-linzhecheng@huawei.com \
--to=linzhecheng@huawei.com \
--cc=jianjay.zhou@huawei.com \
--cc=kraxel@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).