All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gerd Hoffmann <kraxel@redhat.com>
To: qemu-devel@nongnu.org
Cc: Gerd Hoffmann <kraxel@redhat.com>, linzhecheng <linzhecheng@huawei.com>
Subject: [Qemu-devel] [PULL 2/5] usb-host: reset and close libusb_device_handle before qemu exit
Date: Fri, 14 Dec 2018 11:38:51 +0100	[thread overview]
Message-ID: <20181214103854.13820-3-kraxel@redhat.com> (raw)
In-Reply-To: <20181214103854.13820-1-kraxel@redhat.com>

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 --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.9.3

  parent reply	other threads:[~2018-12-14 10:39 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-14 10:38 [Qemu-devel] [PULL 0/5] Usb 20181214 patches Gerd Hoffmann
2018-12-14 10:38 ` [Qemu-devel] [PULL 1/5] pvusb: set max grants only in initialise Gerd Hoffmann
2018-12-14 10:38 ` Gerd Hoffmann [this message]
2018-12-14 10:38 ` [Qemu-devel] [PULL 3/5] ehci: fix fetch qtd race Gerd Hoffmann
2018-12-14 10:38 ` [Qemu-devel] [PULL 4/5] usb-mtp: use O_NOFOLLOW and O_CLOEXEC Gerd Hoffmann
2018-12-14 10:38 ` [Qemu-devel] [PULL 5/5] usb-mtp: Limit filename to object information size Gerd Hoffmann
2018-12-16 12:48 ` [Qemu-devel] [PULL 0/5] Usb 20181214 patches Peter Maydell

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=20181214103854.13820-3-kraxel@redhat.com \
    --to=kraxel@redhat.com \
    --cc=linzhecheng@huawei.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.