From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55397) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xtx9y-00044x-Hl for qemu-devel@nongnu.org; Thu, 27 Nov 2014 06:23:00 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xtx9q-0005pS-8J for qemu-devel@nongnu.org; Thu, 27 Nov 2014 06:22:54 -0500 Received: from szxga02-in.huawei.com ([119.145.14.65]:23721) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xtx9p-0005o8-IQ for qemu-devel@nongnu.org; Thu, 27 Nov 2014 06:22:46 -0500 Message-ID: <54770972.60206@huawei.com> Date: Thu, 27 Nov 2014 19:22:26 +0800 From: Gonglei MIME-Version: 1.0 References: <1417079052-9372-1-git-send-email-kraxel@redhat.com> <5476EE1B.4090302@huawei.com> <1417086243.3722.26.camel@nilsson.home.kraxel.org> <54770809.1000507@huawei.com> <1417087153.3722.31.camel@nilsson.home.kraxel.org> In-Reply-To: <1417087153.3722.31.camel@nilsson.home.kraxel.org> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [RfC PATCH] hid: handle full ptr queues in post_load List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gerd Hoffmann Cc: "qemu-devel@nongnu.org" , "Dr. David Alan Gilbert" On 2014/11/27 19:19, Gerd Hoffmann wrote: > On Do, 2014-11-27 at 19:16 +0800, Gonglei wrote: >> On 2014/11/27 19:04, Gerd Hoffmann wrote: >> >>> Hi, >>> >>>>> + evt = s->ptr.queue[(s->head+s->n) & QUEUE_MASK]; >>>> >>>> s->n is QUEUE_LENGTH, can we directly delete it? >>>> evt = s->ptr.queue[s->head & QUEUE_MASK] >>> >>> I prefer to make clear in the code that we want the last ring element >>> not the first and leave in the "+n", even if we could take it out. >>> >> OK. >> >> Another question, whether or not we handle this scenario >> before calling hid_set_next_idle(s) ? Maybe it is safer, because >> hid_idle_timer will call hid_pointer_event(), callback function >> of hs->event(hs). > > Not needed, the timer will not called before vmload is completely > finished. > Yep, as the Qemu big lock. I will test this patch later, thanks for your work. :) Regards, -Gonglei