The case of no active timers is relatively common. Check it outside the lock.
Signed-off-by: Paolo Bonzini <pbonz...@redhat.com> --- qemu-timer.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/qemu-timer.c b/qemu-timer.c index 2463fe6..dc11ab9 100644 --- a/qemu-timer.c +++ b/qemu-timer.c @@ -476,6 +476,10 @@ bool timerlist_run_timers(QEMUTimerList *timer_list) QEMUTimerCB *cb; void *opaque; + if (!atomic_read(&timer_list->active_timers)) { + return false; + } + qemu_event_reset(&timer_list->timers_done_ev); if (!timer_list->clock->enabled) { goto out; -- 2.4.3