All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gonglei <arei.gonglei@huawei.com>
To: Gerd Hoffmann <kraxel@redhat.com>
Cc: "qemu-devel@nongnu.org" <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [RFC] Break cross migration from qemu-1.5 to qemu-2.1. because of input/hid rewriting
Date: Fri, 21 Nov 2014 16:44:34 +0800	[thread overview]
Message-ID: <546EFB72.2010106@huawei.com> (raw)
In-Reply-To: <1416557171.29248.7.camel@nilsson.home.kraxel.org>

On 2014/11/21 16:06, Gerd Hoffmann wrote:

>> What about this patch:
>>
>> diff --git a/hw/input/hid.c b/hw/input/hid.c
>> index 148c003..56e0637 100644
>> --- a/hw/input/hid.c
>> +++ b/hw/input/hid.c
>> @@ -116,7 +116,7 @@ static void hid_pointer_event(DeviceState *dev, QemuConsole *src,
>>      HIDState *hs = (HIDState *)dev;
>>      HIDPointerEvent *e;
>>
>> -    assert(hs->n < QUEUE_LENGTH);
>> +    assert(hs->n <= QUEUE_LENGTH);
>>      e = &hs->ptr.queue[(hs->head + hs->n) & QUEUE_MASK];
>>
>>      switch (evt->kind) {
> 
> No.  There is a reason this assert is in there.  This needs to be
> handled in a post_load function, to bring the queue into a state 2.1 can
> deal with.
> 

OK.

> Easiest would be to just flush the queue in case n == 16, or leave in
> there a single event with final pointer location and button state.
> 
> I think you can also try to combine events (like it is done for
> event_compression = true).  qemu 1.5 was less aggressive in doing that
> (only did it when the queue was full), so chances are high that you'll
> find events in the queue with identical button state where you can
> either just drop all but the last first (tablet mode) or add up the
> motions (mouse mode).  Not sure it is worth the trouble though.
> 

Sorry, I'm not familiar with the realization of input/hid module. Could you
please post a patch for this issue? Thanks a lot!

Best regards,
-Gonglei

  reply	other threads:[~2014-11-21  8:45 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-20 13:03 [Qemu-devel] [RFC] Break cross migration from qemu-1.5 to qemu-2.1. because of input/hid rewriting Gonglei
2014-11-21  8:06 ` Gerd Hoffmann
2014-11-21  8:44   ` Gonglei [this message]
2014-11-21 15:16 ` Dr. David Alan Gilbert
2014-11-24  9:08   ` Gonglei
2014-11-24  9:10     ` Gonglei

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=546EFB72.2010106@huawei.com \
    --to=arei.gonglei@huawei.com \
    --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 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.