qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Amos Kong <akong@redhat.com>
To: Anthony Liguori <aliguori@us.ibm.com>
Cc: peter.maydell@linaro.org, lilei@linux.vnet.ibm.com,
	qemu-devel@nongnu.org, kraxel@redhat.com,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	lersek@redhat.com, "Andreas Färber" <afaerber@suse.de>
Subject: Re: [Qemu-devel] [PATCH v2 1/2] ps2: add support of auto-repeat
Date: Fri, 14 Jun 2013 11:45:57 +0800	[thread overview]
Message-ID: <20130614034557.GA6003@t430s.nay.redhat.com> (raw)
In-Reply-To: <87hah127cx.fsf@codemonkey.ws>

On Thu, Jun 13, 2013 at 01:28:14PM -0500, Anthony Liguori wrote:
> Paolo Bonzini <pbonzini@redhat.com> writes:
> > Il 13/06/2013 09:01, Anthony Liguori ha scritto:
> >> Paolo Bonzini <pbonzini@redhat.com> writes:

> >>>>>  static bool ps2_keyboard_ledstate_needed(void *opaque)
> >>>>> @@ -638,9 +648,12 @@ static const VMStateDescription
> >>>>> vmstate_ps2_keyboard_repeatstate = {
> >>>>>      .version_id = 3,
> >>>>>      .minimum_version_id = 2,
> >>>>>      .minimum_version_id_old = 2,
> >>>>> +    .load_state_old = ps2_kbd_repeatstate_load,
> >>>>>      .fields      = (VMStateField[]) {
> >>>>>          VMSTATE_INT32(repeat_period, PS2KbdState),
> >>>>>          VMSTATE_INT32(repeat_delay, PS2KbdState),
> >>>>> +        VMSTATE_INT32(repeat_key, PS2KbdState),
> >>>>> +        VMSTATE_TIMER(repeat_timer, PS2KbdState),
> >>>>
> >>>> You can't just add fields here, they'd need to be specific to a new
> >>>> version 4. Requested was to make it a subsection instead.
> >>>
> >>> This is already a subsection, and this patch is just a proposal to be
> >>> squashed in this series (which adds the subsection).  But I think Amos
> >>> is right and only the period/delay need to be migrated.  Otherwise,
> >>> you'll get an endless stream of repeats on the destination.
>
> >> Not with seamless migration and spice.

Auto-repeat is just a feature of keyboard hardware.
ps2 keyboard will repeatedly emit events to guest.

But for guest side, it could not repeatedly input/display
one key if it only receive a press event and wait a long time.

I used a timer to emulate hardware to repeatedly emit press
events to guest.


(1) IF we migrate the timer: (problem occured :(
when we execute migrate/re-connect, and qemu doesn't receive
the release event from host system. Auto-repeat will
continua, even qemu doesn't get events from host system.

(1) IF we DON'T migrate the repeat_timer: (everything is ok :)
when we execute re-connection or migration, qemu can continually
receive press events from host system if the key is pressed in the
new vnc/spice side. The key _can_be auto-repeatedly inputed.


SO we should not migrate the repeat_timer.

The auto-repeated input after migration/re-connection should be
decided by if the key is pressed in the new spice/vnc client.


Amos.

> > Which BTW is broken right now in Fedora, though I didn't investigate
> > who's the culprit. :)
> >
> >> Even with a non-seamless VNC reconnect, if it happens behind the scenes
> >> the release would still be sent.
>
> > Where is the code for that?  Are SDL/GTK/whatnot covered as well?
> 
> What I mean by non-seamless migration is a management tool transparently
> reconnecting after live migration.
>
> I assume virt-manager does this but we certainly have management
> products that do this.
> 
> The (remote) user see a blib in the session but if they had a key held
> down, then the release will certainly still be sent to the other end.
> 
> Even with GTK/SDL, if a key was depressed it will continue to be
> depressed which will cause odd behavior with accelerators.  At least
> with key repeat happening it's more obvious to the user that a key is
> stuck.
> 
> Regards,
> 
> Anthony Liguori
> 
> >
> > Paolo

  reply	other threads:[~2013-06-14  3:46 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-22 16:10 [Qemu-devel] [PATCH v2 0/2] ps2 auto-repeat Amos Kong
2013-05-22 16:10 ` [Qemu-devel] [PATCH v2 1/2] ps2: add support of auto-repeat Amos Kong
2013-05-30 16:48   ` Anthony Liguori
2013-05-31 12:31     ` Amos Kong
2013-06-13 10:04       ` Amos Kong
2013-06-13 12:01         ` Anthony Liguori
2013-06-13 10:19       ` Andreas Färber
2013-06-13 12:34         ` Paolo Bonzini
2013-06-13 13:01           ` Anthony Liguori
2013-06-13 14:47             ` Paolo Bonzini
2013-06-13 18:28               ` Anthony Liguori
2013-06-14  3:45                 ` Amos Kong [this message]
2013-06-14  5:46       ` Amos Kong
2013-06-17 13:01         ` Luiz Capitulino
2013-06-26 11:56           ` Markus Armbruster
2013-07-02  6:49             ` Amos Kong
2013-07-23 12:43               ` Gerd Hoffmann
2013-05-22 16:10 ` [Qemu-devel] [PATCH v2 2/2] ps2: preserve repeat state on migration Amos Kong
2013-05-30 16:49   ` Anthony Liguori

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=20130614034557.GA6003@t430s.nay.redhat.com \
    --to=akong@redhat.com \
    --cc=afaerber@suse.de \
    --cc=aliguori@us.ibm.com \
    --cc=kraxel@redhat.com \
    --cc=lersek@redhat.com \
    --cc=lilei@linux.vnet.ibm.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --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).