mirror of https://github.com/proxmox/mirror_qemu
Run timers from host alarm timer callback
This further cleans up the main loop getting it a lot closer to what a main loop should be. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5636 c046a42c-6fe2-441c-8c8c-71466251a162master
parent
6abfbd79b2
commit
5bec1d1dea
19
vl.c
19
vl.c
|
@ -1700,6 +1700,15 @@ static void try_to_rearm_timer(void *opaque)
|
||||||
len = read(alarm_timer_rfd, buffer, sizeof(buffer));
|
len = read(alarm_timer_rfd, buffer, sizeof(buffer));
|
||||||
} while ((len == -1 && errno == EINTR) || len > 0);
|
} while ((len == -1 && errno == EINTR) || len > 0);
|
||||||
|
|
||||||
|
/* vm time timers */
|
||||||
|
if (vm_running && likely(!(cur_cpu->singlestep_enabled & SSTEP_NOTIMER)))
|
||||||
|
qemu_run_timers(&active_timers[QEMU_TIMER_VIRTUAL],
|
||||||
|
qemu_get_clock(vm_clock));
|
||||||
|
|
||||||
|
/* real time timers */
|
||||||
|
qemu_run_timers(&active_timers[QEMU_TIMER_REALTIME],
|
||||||
|
qemu_get_clock(rt_clock));
|
||||||
|
|
||||||
if (t->flags & ALARM_FLAG_EXPIRED) {
|
if (t->flags & ALARM_FLAG_EXPIRED) {
|
||||||
alarm_timer->flags &= ~ALARM_FLAG_EXPIRED;
|
alarm_timer->flags &= ~ALARM_FLAG_EXPIRED;
|
||||||
qemu_rearm_alarm_timer(alarm_timer);
|
qemu_rearm_alarm_timer(alarm_timer);
|
||||||
|
@ -4551,16 +4560,6 @@ void main_loop_wait(int timeout)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (vm_running) {
|
|
||||||
if (likely(!(cur_cpu->singlestep_enabled & SSTEP_NOTIMER)))
|
|
||||||
qemu_run_timers(&active_timers[QEMU_TIMER_VIRTUAL],
|
|
||||||
qemu_get_clock(vm_clock));
|
|
||||||
}
|
|
||||||
|
|
||||||
/* real time timers */
|
|
||||||
qemu_run_timers(&active_timers[QEMU_TIMER_REALTIME],
|
|
||||||
qemu_get_clock(rt_clock));
|
|
||||||
|
|
||||||
/* Check bottom-halves last in case any of the earlier events triggered
|
/* Check bottom-halves last in case any of the earlier events triggered
|
||||||
them. */
|
them. */
|
||||||
qemu_bh_poll();
|
qemu_bh_poll();
|
||||||
|
|
Loading…
Reference in New Issue