qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [RFC] [PATCHv6 01/16] aio / timers: add qemu-timer.c ut


From: Stefan Hajnoczi
Subject: Re: [Qemu-devel] [RFC] [PATCHv6 01/16] aio / timers: add qemu-timer.c utility functions
Date: Tue, 6 Aug 2013 14:02:18 +0200
User-agent: Mutt/1.5.21 (2010-09-15)

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 <address@hidden>
> ---
>  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).



reply via email to

[Prev in Thread] Current Thread [Next in Thread]