Received: from [140.186.70.92] (port=40756 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PczuA-0001Sg-PJ for qemu-devel@nongnu.org; Wed, 12 Jan 2011 07:34:25 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Pczu6-0003uz-OY for qemu-devel@nongnu.org; Wed, 12 Jan 2011 07:34:19 -0500 Received: from smtp.eu.citrix.com ([62.200.22.115]:5856) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Pczu6-0003uA-Il for qemu-devel@nongnu.org; Wed, 12 Jan 2011 07:34:18 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Message-ID: <19757.40902.900137.923740@mariner.uk.xensource.com> Date: Wed, 12 Jan 2011 12:34:14 +0000 In-Reply-To: <1294834760-24996-1-git-send-email-pbonzini@redhat.com> References: <1294834760-24996-1-git-send-email-pbonzini@redhat.com> From: Ian Jackson Subject: [Qemu-devel] Re: [PATCH v2] add event queueing to USB HID List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: Stefano Stabellini , "qemu-devel@nongnu.org" , Gerd Hoffman Paolo Bonzini writes ("[PATCH v2] add event queueing to USB HID"): > For v2 I changed the head/tail implementation of the FIFO buffer > (which was buggy when the queue became full) to head/count. > I then removed "have_data", which is the same as count>0 > for pointer devices and the same as "changed" for keyboards. > This made event merging more correct than in Ian's code and > easier to understand than my v1. Thanks. Was my code buggy then ? It's possible; the event merging case is not easy to trigger in testing. > I left the "changed" member in USBHIDState, rather than moving it > to the keyboard, because it is useful to handle the idle period > (in USB_TOKEN_IN) in a device-independent way. Without it the > code became more messy. This leaves the same information recorded in the driver in two places and is therefore IMO a bad idea. I still think the way I did this is best: have a common helper function used by the keyboard and pointer code to deal with the idle handling. Ian.