]> git.proxmox.com Git - qemu.git/commit
aio / timers: Split QEMUClock into QEMUClock and QEMUTimerList
authorAlex Bligh <alex@alex.org.uk>
Wed, 21 Aug 2013 15:02:46 +0000 (16:02 +0100)
committerStefan Hajnoczi <stefanha@redhat.com>
Thu, 22 Aug 2013 17:10:27 +0000 (19:10 +0200)
commitff83c66eccf5b5f6b6530d504e3be41559250dcb
tree85fbeb62b89962d992b6ad94827687313b1ec335
parentf9a976b7408f061fc7fc48b14d16797ed6f8fd97
aio / timers: Split QEMUClock into QEMUClock and QEMUTimerList

Split QEMUClock into QEMUClock and QEMUTimerList so that we can
have more than one QEMUTimerList associated with the same clock.

Introduce a main_loop_timerlist concept and make existing
qemu_clock_* calls that actually should operate on a QEMUTimerList
call the relevant QEMUTimerList implementations, using the clock's
default timerlist. This vastly reduces the invasiveness of this
change and means the API stays constant for existing users.

Introduce a list of QEMUTimerLists associated with each clock
so that reenabling the clock can cause all the notifiers
to be called. Note the code to do the notifications is added
in a later patch.

Switch QEMUClockType to an enum. Remove global variables vm_clock,
host_clock and rt_clock and add compatibility defines. Do not
fix qemu_next_alarm_deadline as it's going to be deleted.

Add qemu_clock_use_for_deadline to indicate whether a particular
clock should be used for deadline calculations. When use_icount
is true, vm_clock should not be used for deadline calculations
as it does not contain a nanosecond count. Instead, icount
timeouts come from the execution thread doing aio_notify or
qemu_notify as appropriate. This function is used in the next
patch.

Signed-off-by: Alex Bligh <alex@alex.org.uk>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
include/qemu/timer.h
qemu-timer.c