|
Hans de Goede |
56753f |
From f87b93c3944652f90e2c0010da6ee8c182382369 Mon Sep 17 00:00:00 2001
|
|
Hans de Goede |
56753f |
From: Gerd Hoffmann <kraxel@redhat.com>
|
|
Hans de Goede |
56753f |
Date: Wed, 15 Feb 2012 09:15:37 +0100
|
|
Hans de Goede |
56753f |
Subject: [PATCH 402/434] input: send kbd+mouse events only to running guests.
|
|
Hans de Goede |
56753f |
|
|
Hans de Goede |
56753f |
Trying to interact with a stopped guest will queue up the events,
|
|
Hans de Goede |
56753f |
then send them all at once when the guest continues running, with
|
|
Hans de Goede |
56753f |
a high chance to have them cause unwanted actions.
|
|
Hans de Goede |
56753f |
|
|
Hans de Goede |
56753f |
Avoid that by only injecting the input events only when the guest
|
|
Hans de Goede |
56753f |
is in running state.
|
|
Hans de Goede |
56753f |
|
|
Hans de Goede |
56753f |
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
|
|
Hans de Goede |
56753f |
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
|
|
Hans de Goede |
56753f |
---
|
|
Hans de Goede |
56753f |
input.c | 6 ++++++
|
|
Hans de Goede |
56753f |
1 file changed, 6 insertions(+)
|
|
Hans de Goede |
56753f |
|
|
Hans de Goede |
56753f |
diff --git a/input.c b/input.c
|
|
Hans de Goede |
56753f |
index 9ade63f..b48408d 100644
|
|
Hans de Goede |
56753f |
--- a/input.c
|
|
Hans de Goede |
56753f |
+++ b/input.c
|
|
Hans de Goede |
56753f |
@@ -130,6 +130,9 @@ void qemu_remove_led_event_handler(QEMUPutLEDEntry *entry)
|
|
Hans de Goede |
56753f |
|
|
Hans de Goede |
56753f |
void kbd_put_keycode(int keycode)
|
|
Hans de Goede |
56753f |
{
|
|
Hans de Goede |
56753f |
+ if (!runstate_is_running()) {
|
|
Hans de Goede |
56753f |
+ return;
|
|
Hans de Goede |
56753f |
+ }
|
|
Hans de Goede |
56753f |
if (qemu_put_kbd_event) {
|
|
Hans de Goede |
56753f |
qemu_put_kbd_event(qemu_put_kbd_event_opaque, keycode);
|
|
Hans de Goede |
56753f |
}
|
|
Hans de Goede |
56753f |
@@ -151,6 +154,9 @@ void kbd_mouse_event(int dx, int dy, int dz, int buttons_state)
|
|
Hans de Goede |
56753f |
void *mouse_event_opaque;
|
|
Hans de Goede |
56753f |
int width, height;
|
|
Hans de Goede |
56753f |
|
|
Hans de Goede |
56753f |
+ if (!runstate_is_running()) {
|
|
Hans de Goede |
56753f |
+ return;
|
|
Hans de Goede |
56753f |
+ }
|
|
Hans de Goede |
56753f |
if (QTAILQ_EMPTY(&mouse_handlers)) {
|
|
Hans de Goede |
56753f |
return;
|
|
Hans de Goede |
56753f |
}
|
|
Hans de Goede |
56753f |
--
|
|
Hans de Goede |
56753f |
1.7.10
|
|
Hans de Goede |
56753f |
|