From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40128) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V6fyI-00023z-R9 for qemu-devel@nongnu.org; Tue, 06 Aug 2013 08:02:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V6fyC-0005wl-Kt for qemu-devel@nongnu.org; Tue, 06 Aug 2013 08:02:38 -0400 Received: from mx1.redhat.com ([209.132.183.28]:59478) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V6fyC-0005vy-4D for qemu-devel@nongnu.org; Tue, 06 Aug 2013 08:02:32 -0400 Date: Tue, 6 Aug 2013 14:02:18 +0200 From: Stefan Hajnoczi Message-ID: <20130806120218.GB30812@stefanha-thinkpad.redhat.com> References: <1375639805-1943-1-git-send-email-alex@alex.org.uk> <1375780592-22842-1-git-send-email-alex@alex.org.uk> <1375780592-22842-2-git-send-email-alex@alex.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1375780592-22842-2-git-send-email-alex@alex.org.uk> Subject: Re: [Qemu-devel] [RFC] [PATCHv6 01/16] aio / timers: add qemu-timer.c utility functions List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alex Bligh Cc: Kevin Wolf , Anthony Liguori , qemu-devel@nongnu.org, liu ping fan , Paolo Bonzini , MORITA Kazutaka , rth@twiddle.net On Tue, Aug 06, 2013 at 10:16:17AM +0100, Alex Bligh wrote: > Add qemu_free_clock and expose qemu_new_clock and clock types. > > Add utility functions to qemu-timer.c for nanosecond timing. > > Add qemu_clock_deadline_ns to calculate deadlines to > nanosecond accuracy. > > Add utility function qemu_soonest_timeout to calculate soonest deadline. > > Add qemu_timeout_ns_to_ms to convert a timeout in nanoseconds back to > milliseconds for when ppoll is not used. > > Signed-off-by: Alex Bligh > --- > include/qemu/timer.h | 17 ++++++++++++++ > qemu-timer.c | 63 +++++++++++++++++++++++++++++++++++++++++++++----- > 2 files changed, 74 insertions(+), 6 deletions(-) There is still too much happening in this patch. Making qemu_new_clock()/qemu_free_clock() public and moving the clock source constants can be done in a single patch. The next patch can change the semantics of qemu_clock_deadline() to return INT32_MAX when the clock source is disabled. I'm not sure why you do this and whether you checked that existing users continue to work correctly? This is worth a separate patch. Introducing qemu_timeout_ns_to_ms() and qemu_soonest_timeout() could be done separately or together, I don't care as much there. Please include an explanation of why qemu_timeout_ns_to_ms() will be needed in the future (there are no callers in this patch).