mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-07-27 04:13:53 -06:00
timer: introduce new virtual clock
Slirp and VNC modules use virtual clock for processing some events that are related to the guest execution speed. But virtual clock-related events are consideres to be deterministic and are recorded/replayed by icount mechanism. But slirp and VNC lie outside the recorded guest core (which includes CPU and peripherals). Therefore slirp and VNC are external for the guest, but should work at guest speed. This patch introduces new virtual clock which can be used for external subsystems for running timers that are synchronized with the guest. Signed-off-by: Pavel Dovgalyuk <Pavel.Dovgaluk@ispras.ru> Message-Id: <20180912082002.3228.82417.stgit@pasha-VirtualBox> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
bb3d7702e8
commit
87f4fe7653
2 changed files with 11 additions and 0 deletions
|
@ -496,6 +496,7 @@ bool timerlist_run_timers(QEMUTimerList *timer_list)
|
|||
|
||||
switch (timer_list->clock->type) {
|
||||
case QEMU_CLOCK_REALTIME:
|
||||
case QEMU_CLOCK_VIRTUAL_EXT:
|
||||
break;
|
||||
default:
|
||||
case QEMU_CLOCK_VIRTUAL:
|
||||
|
@ -597,6 +598,7 @@ int64_t qemu_clock_get_ns(QEMUClockType type)
|
|||
return get_clock();
|
||||
default:
|
||||
case QEMU_CLOCK_VIRTUAL:
|
||||
case QEMU_CLOCK_VIRTUAL_EXT:
|
||||
if (use_icount) {
|
||||
return cpu_get_icount();
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue