From: Markus Armbruster <armbru@redhat.com>
To: Amos Kong <akong@redhat.com>
Cc: qemu-devel@nongnu.org, lcapitulino@redhat.com
Subject: Re: [Qemu-devel] [PATCH] monitor: fix the wrong order of releasing keys
Date: Tue, 16 Apr 2013 09:08:12 +0200 [thread overview]
Message-ID: <87ppxvosv7.fsf@blackfin.pond.sub.org> (raw)
In-Reply-To: <1366091252-16802-1-git-send-email-akong@redhat.com> (Amos Kong's message of "Tue, 16 Apr 2013 13:47:32 +0800")
Amos Kong <akong@redhat.com> writes:
> (qemu) sendkey ctrl_r-scroll_lock-scroll_lock
>
> Executing this command could not let Windows guest panic, it caused by
"could not"?
> the wrong order of releasing keys. This problem was introduced by
> commit e4c8f004c55d9da3eae3e14df740238bf805b5d6.
>
> The right release order should be starting from last item.
>
> Signed-off-by: Amos Kong <akong@redhat.com>
> ---
> ui/input.c | 8 +++-----
> 1 files changed, 3 insertions(+), 5 deletions(-)
>
> diff --git a/ui/input.c b/ui/input.c
> index 9abef0c..ecfeb43 100644
> --- a/ui/input.c
> +++ b/ui/input.c
> @@ -234,13 +234,11 @@ static void free_keycodes(void)
>
> static void release_keys(void *opaque)
> {
> - int i;
> -
> - for (i = 0; i < keycodes_size; i++) {
> - if (keycodes[i] & 0x80) {
> + while (keycodes_size > 0) {
> + if (keycodes[--keycodes_size] & 0x80) {
> kbd_put_keycode(0xe0);
> }
> - kbd_put_keycode(keycodes[i]| 0x80);
> + kbd_put_keycode(keycodes[keycodes_size] | 0x80);
> }
>
> free_keycodes();
next prev parent reply other threads:[~2013-04-16 7:08 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-16 5:47 [Qemu-devel] [PATCH] monitor: fix the wrong order of releasing keys Amos Kong
2013-04-16 7:08 ` Markus Armbruster [this message]
2013-04-17 13:28 ` Luiz Capitulino
2013-04-17 13:21 ` Luiz Capitulino
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=87ppxvosv7.fsf@blackfin.pond.sub.org \
--to=armbru@redhat.com \
--cc=akong@redhat.com \
--cc=lcapitulino@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.