qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Anthony Liguori <anthony@codemonkey.ws>
To: Gerd Hoffmann <kraxel@redhat.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] input: send kbd+mouse events only to running guests.
Date: Fri, 17 Feb 2012 12:17:06 -0600	[thread overview]
Message-ID: <4F3E99A2.8050304@redhat.com> (raw)
In-Reply-To: <1329293737-20683-1-git-send-email-kraxel@redhat.com>

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<kraxel@redhat.com>

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	other threads:[~2012-02-17 18:17 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-15  8:15 [Qemu-devel] [PATCH] input: send kbd+mouse events only to running guests Gerd Hoffmann
2012-02-17 18:17 ` Anthony Liguori [this message]

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=4F3E99A2.8050304@redhat.com \
    --to=anthony@codemonkey.ws \
    --cc=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).