On qemu_mod_timer_ns, ensure qemu_notify or aio_notify is called to end the appropriate poll().
On qemu_clock_enable, ensure qemu_notify or aio_notify is called for all QEMUTimerLists attached to the QEMUClock. Signed-off-by: Alex Bligh <a...@alex.org.uk> --- qemu-timer.c | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/qemu-timer.c b/qemu-timer.c index 9d992d6..ade1449 100644 --- a/qemu-timer.c +++ b/qemu-timer.c @@ -295,11 +295,29 @@ void qemu_free_timerlist(QEMUTimerList *tl) g_free(tl); } +static void qemu_timerlist_notify(QEMUTimerList *tl) +{ + if (tl->ctx) { + aio_notify(tl->ctx); + } else { + qemu_notify_event(); + } +} + +static void qemu_clock_notify(QEMUClock *clock) +{ + QEMUTimerList *tl; + QLIST_FOREACH(tl, &clock->timerlists, list) { + qemu_timerlist_notify(tl); + } +} + void qemu_clock_enable(QEMUClock *clock, bool enabled) { bool old = clock->enabled; clock->enabled = enabled; if (enabled && !old) { + qemu_clock_notify(clock); qemu_rearm_alarm_timer(alarm_timer); } } @@ -514,9 +532,7 @@ void qemu_mod_timer_ns(QEMUTimer *ts, int64_t expire_time) } /* Interrupt execution to force deadline recalculation. */ qemu_clock_warp(ts->tl->clock); - if (use_icount) { - qemu_notify_event(); - } + qemu_timerlist_notify(ts->tl); } } -- 1.7.9.5