From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34940) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XrjqF-00012I-Hf for qemu-devel@nongnu.org; Fri, 21 Nov 2014 03:45:29 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xrjq9-0005RH-D7 for qemu-devel@nongnu.org; Fri, 21 Nov 2014 03:45:23 -0500 Received: from szxga03-in.huawei.com ([119.145.14.66]:5590) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xrjq8-0004yB-NH for qemu-devel@nongnu.org; Fri, 21 Nov 2014 03:45:17 -0500 Message-ID: <546EFB72.2010106@huawei.com> Date: Fri, 21 Nov 2014 16:44:34 +0800 From: Gonglei MIME-Version: 1.0 References: <546DE6AD.8010007@huawei.com> <1416557171.29248.7.camel@nilsson.home.kraxel.org> In-Reply-To: <1416557171.29248.7.camel@nilsson.home.kraxel.org> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [RFC] Break cross migration from qemu-1.5 to qemu-2.1. because of input/hid rewriting List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gerd Hoffmann Cc: "qemu-devel@nongnu.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