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 <a...@alex.org.uk>
> ---
>  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