From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41262) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XtyBy-0004Jd-6F for qemu-devel@nongnu.org; Thu, 27 Nov 2014 07:29:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XtyBt-0003ne-22 for qemu-devel@nongnu.org; Thu, 27 Nov 2014 07:29:02 -0500 Received: from szxga02-in.huawei.com ([119.145.14.65]:55147) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XtyBs-0003ky-50 for qemu-devel@nongnu.org; Thu, 27 Nov 2014 07:28:56 -0500 Message-ID: <547718F6.6080803@huawei.com> Date: Thu, 27 Nov 2014 20:28:38 +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> <54770972.60206@huawei.com> In-Reply-To: <54770972.60206@huawei.com> 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:22, Gonglei wrote: > 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. :) > Patch works for me. Thanks. Tested-by: Gonglei Reviewed-by: Gonglei Regards, -Gonglei