diff options
author | Jan Kiszka <jan.kiszka@siemens.com> | 2009-09-15 13:36:04 +0200 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2009-10-05 09:32:45 -0500 |
commit | 21d5d12bb0ad4de7cc92a7a2d018e7ec0f9fd148 (patch) | |
tree | 3297270a5b65d8d59d8e114d7fe3105e1330dffa /qemu-timer.h | |
parent | f64382bad849a16208d30988ef28d5e7375099da (diff) |
Introduce QEMU_CLOCK_HOST
Despite its name QEMU_CLOCK_REALTIME is (normally) not using
CLOCK_REALTIME / the host system time as base. In order to allow also
non-trivial RTC emulations (MC146818) to follow the host time instead of
the virtual guest time, introduce the new clock type QEMU_CLOCK_HOST. It
is unconditionally based on CLOCK_REALTIME, thus will follow system time
changes of the host.
The only limitation of its current implementation is that pending
host_clock timers may not fire early if the host time is pushed forward
beyond their expiry. So far no urgent need to overcome this limitation
was identified, so it's left as simple as it is (expiry on next alarm
timer tick).
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'qemu-timer.h')
-rw-r--r-- | qemu-timer.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/qemu-timer.h b/qemu-timer.h index e44c33420f..e7eaa0436c 100644 --- a/qemu-timer.h +++ b/qemu-timer.h @@ -17,6 +17,13 @@ extern QEMUClock *rt_clock; precision clock, usually cpu cycles (use ticks_per_sec). */ extern QEMUClock *vm_clock; +/* The host clock should be use for device models that emulate accurate + real time sources. It will continue to run when the virtual machine + is suspended, and it will reflect system time changes the host may + undergo (e.g. due to NTP). The host clock has the same precision as + the virtual clock. */ +extern QEMUClock *host_clock; + int64_t qemu_get_clock(QEMUClock *clock); QEMUTimer *qemu_new_timer(QEMUClock *clock, QEMUTimerCB *cb, void *opaque); |