[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 4/6] usb-host: attach only to running guest
From: |
Gerd Hoffmann |
Subject: |
[Qemu-devel] [PATCH 4/6] usb-host: attach only to running guest |
Date: |
Wed, 20 Jun 2012 16:05:32 +0200 |
Signed-off-by: Gerd Hoffmann <address@hidden>
---
hw/usb/host-linux.c | 32 +++++++++++++++++---------------
1 files changed, 17 insertions(+), 15 deletions(-)
diff --git a/hw/usb/host-linux.c b/hw/usb/host-linux.c
index a95b0ed..06b6ed3 100644
--- a/hw/usb/host-linux.c
+++ b/hw/usb/host-linux.c
@@ -1737,25 +1737,27 @@ static void usb_host_auto_check(void *unused)
struct USBHostDevice *s;
int unconnected = 0;
- usb_host_scan(NULL, usb_host_auto_scan);
+ if (runstate_is_running()) {
+ usb_host_scan(NULL, usb_host_auto_scan);
- QTAILQ_FOREACH(s, &hostdevs, next) {
- if (s->fd == -1) {
- unconnected++;
- }
- if (s->seen == 0) {
- s->errcount = 0;
+ QTAILQ_FOREACH(s, &hostdevs, next) {
+ if (s->fd == -1) {
+ unconnected++;
+ }
+ if (s->seen == 0) {
+ s->errcount = 0;
+ }
+ s->seen = 0;
}
- s->seen = 0;
- }
- if (unconnected == 0) {
- /* nothing to watch */
- if (usb_auto_timer) {
- qemu_del_timer(usb_auto_timer);
- trace_usb_host_auto_scan_disabled();
+ if (unconnected == 0) {
+ /* nothing to watch */
+ if (usb_auto_timer) {
+ qemu_del_timer(usb_auto_timer);
+ trace_usb_host_auto_scan_disabled();
+ }
+ return;
}
- return;
}
if (!usb_auto_timer) {
--
1.7.1
- [Qemu-devel] [PULL 0/6] usb patch queue., Gerd Hoffmann, 2012/06/20
- [Qemu-devel] [PATCH 6/6] uhci: fix uhci_async_cancel_all, Gerd Hoffmann, 2012/06/20
- [Qemu-devel] [PATCH 4/6] usb-host: attach only to running guest,
Gerd Hoffmann <=
- [Qemu-devel] [PATCH 2/6] usb: restore USBDevice->attached on vmload, Gerd Hoffmann, 2012/06/20
- [Qemu-devel] [PATCH 5/6] usb-host: live migration support, Gerd Hoffmann, 2012/06/20
- [Qemu-devel] [PATCH 1/6] ehci: add live migration support, Gerd Hoffmann, 2012/06/20
- [Qemu-devel] [PATCH 3/6] ehci: tracing improvements, Gerd Hoffmann, 2012/06/20
- Re: [Qemu-devel] [PULL 0/6] usb patch queue., Anthony Liguori, 2012/06/26