From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:39526) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RySMs-0003ws-9I for qemu-devel@nongnu.org; Fri, 17 Feb 2012 13:17:30 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RySMp-0002w8-1N for qemu-devel@nongnu.org; Fri, 17 Feb 2012 13:17:14 -0500 Received: from mail-pw0-f45.google.com ([209.85.160.45]:38074) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RySMo-0002rW-2o for qemu-devel@nongnu.org; Fri, 17 Feb 2012 13:17:10 -0500 Received: by mail-pw0-f45.google.com with SMTP id ro12so4829620pbb.4 for ; Fri, 17 Feb 2012 10:17:09 -0800 (PST) Message-ID: <4F3E99A2.8050304@redhat.com> Date: Fri, 17 Feb 2012 12:17:06 -0600 From: Anthony Liguori MIME-Version: 1.0 References: <1329293737-20683-1-git-send-email-kraxel@redhat.com> In-Reply-To: <1329293737-20683-1-git-send-email-kraxel@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] input: send kbd+mouse events only to running guests. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gerd Hoffmann Cc: qemu-devel@nongnu.org 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 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; > }