From: Gerd Hoffmann <kraxel@redhat.com>
To: qemu-devel@nongnu.org
Cc: Gerd Hoffmann <kraxel@redhat.com>
Subject: [Qemu-devel] [PATCH] usb-hid: activate usb tablet / mouse after migration.
Date: Wed, 12 Oct 2011 13:30:34 +0200 [thread overview]
Message-ID: <1318419034-15287-1-git-send-email-kraxel@redhat.com> (raw)
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 <kraxel@redhat.com>
---
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 7c564b6..997f828 100644
--- a/hw/usb-hid.c
+++ b/hw/usb-hid.c
@@ -520,10 +520,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
next reply other threads:[~2011-10-12 11:30 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-12 11:30 Gerd Hoffmann [this message]
2011-10-13 2:09 ` [Qemu-devel] [PATCH] usb-hid: activate usb tablet / mouse after migration TeLeMan
2011-10-13 10:48 ` Gerd Hoffmann
2011-10-16 8:54 ` TeLeMan
2011-10-21 9:22 ` Gerd Hoffmann
2012-02-20 10:42 ` Peter Lieven
2012-02-21 16:25 ` Peter Lieven
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=1318419034-15287-1-git-send-email-kraxel@redhat.com \
--to=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).