[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 8/9] usb-hid: activate usb tablet / mouse after migr
From: |
Gerd Hoffmann |
Subject: |
[Qemu-devel] [PATCH 8/9] usb-hid: activate usb tablet / mouse after migration. |
Date: |
Thu, 13 Oct 2011 13:08:30 +0200 |
qemu uses the ps/2 mouse by default. The usb tablet (or mouse) is
activated as soon as qemu sees some guest activity on the device,
i.e. polling for HID events. That used to work fine for both fresh
boot and migration.
Remote wakeup support changed the picture though: There will be no
polling after migration in case the guest suspended the usb bus,
waiting for wakeup events. Result is that the ps/2 mouse stays
active.
Fix this by activating the usb tablet / mouse in post_load() in case
the guest enabled remote wakeup.
Signed-off-by: Gerd Hoffmann <address@hidden>
---
hw/usb-hid.c | 11 +++++++++++
1 files changed, 11 insertions(+), 0 deletions(-)
diff --git a/hw/usb-hid.c b/hw/usb-hid.c
index ba79466..a110c74 100644
--- a/hw/usb-hid.c
+++ b/hw/usb-hid.c
@@ -527,10 +527,21 @@ static int usb_keyboard_initfn(USBDevice *dev)
return usb_hid_initfn(dev, HID_KEYBOARD);
}
+static int usb_ptr_post_load(void *opaque, int version_id)
+{
+ USBHIDState *s = opaque;
+
+ if (s->dev.remote_wakeup) {
+ hid_pointer_activate(&s->hid);
+ }
+ return 0;
+}
+
static const VMStateDescription vmstate_usb_ptr = {
.name = "usb-ptr",
.version_id = 1,
.minimum_version_id = 1,
+ .post_load = usb_ptr_post_load,
.fields = (VMStateField []) {
VMSTATE_USB_DEVICE(dev, USBHIDState),
VMSTATE_HID_POINTER_DEVICE(hid, USBHIDState),
--
1.7.1
- [Qemu-devel] [PULL] usb patch queue, Gerd Hoffmann, 2011/10/13
- [Qemu-devel] [PATCH 1/9] usb-storage: fix NULL pointer dereference., Gerd Hoffmann, 2011/10/13
- [Qemu-devel] [PATCH 2/9] usb-hub: need to check dev->attached, Gerd Hoffmann, 2011/10/13
- [Qemu-devel] [PATCH 5/9] usb-host: handle USBDEVFS_SETCONFIGURATION returning EBUSY, Gerd Hoffmann, 2011/10/13
- [Qemu-devel] [PATCH 9/9] usb-hub: don't trigger assert on packet completion., Gerd Hoffmann, 2011/10/13
- [Qemu-devel] [PATCH 7/9] hw/usb-ohci: Honour endpoint maximum packet size, Gerd Hoffmann, 2011/10/13
- [Qemu-devel] [PATCH 4/9] usb-host: factor out code, Gerd Hoffmann, 2011/10/13
- [Qemu-devel] [PATCH 3/9] usb: fix port reset, Gerd Hoffmann, 2011/10/13
- [Qemu-devel] [PATCH 8/9] usb-hid: activate usb tablet / mouse after migration.,
Gerd Hoffmann <=
- [Qemu-devel] [PATCH 6/9] hw/usb-ohci: Fix OHCI_TD_T1 bit position definition, Gerd Hoffmann, 2011/10/13
- Re: [Qemu-devel] [PULL] usb patch queue, Anthony Liguori, 2011/10/14