usb-host: attach only to running guest

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
This commit is contained in:
Gerd Hoffmann 2012-06-08 13:02:52 +02:00
parent 30e9d4120f
commit a844ed842d

View File

@ -1737,6 +1737,7 @@ static void usb_host_auto_check(void *unused)
struct USBHostDevice *s;
int unconnected = 0;
if (runstate_is_running()) {
usb_host_scan(NULL, usb_host_auto_scan);
QTAILQ_FOREACH(s, &hostdevs, next) {
@ -1757,6 +1758,7 @@ static void usb_host_auto_check(void *unused)
}
return;
}
}
if (!usb_auto_timer) {
usb_auto_timer = qemu_new_timer_ms(rt_clock, usb_host_auto_check, NULL);