qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] input: send kbd+mouse events only to running gu


From: Anthony Liguori
Subject: Re: [Qemu-devel] [PATCH] input: send kbd+mouse events only to running guests.
Date: Fri, 17 Feb 2012 12:17:06 -0600
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.23) Gecko/20110922 Lightning/1.0b2 Thunderbird/3.1.15

On 02/15/2012 02:15 AM, Gerd Hoffmann wrote:
Trying to interact with a stopped guest will queue up the events,
then send them all at once when the guest continues running, with
a high chance to have them cause unwanted actions.

Avoid that by only injecting the input events only when the guest
is in running state.

Signed-off-by: Gerd Hoffmann<address@hidden>

Applied.  Thanks.

Regards,

Anthony Liguori

---
  input.c |    6 ++++++
  1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/input.c b/input.c
index 9ade63f..b48408d 100644
--- a/input.c
+++ b/input.c
@@ -130,6 +130,9 @@ void qemu_remove_led_event_handler(QEMUPutLEDEntry *entry)

  void kbd_put_keycode(int keycode)
  {
+    if (!runstate_is_running()) {
+        return;
+    }
      if (qemu_put_kbd_event) {
          qemu_put_kbd_event(qemu_put_kbd_event_opaque, keycode);
      }
@@ -151,6 +154,9 @@ void kbd_mouse_event(int dx, int dy, int dz, int 
buttons_state)
      void *mouse_event_opaque;
      int width, height;

+    if (!runstate_is_running()) {
+        return;
+    }
      if (QTAILQ_EMPTY(&mouse_handlers)) {
          return;
      }




reply via email to

[Prev in Thread] Current Thread [Next in Thread]