diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2017-03-03 11:37:57 +0100 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2017-03-14 13:26:42 +0100 |
commit | 33bef0b9948b85000221d32c758d9d4a9276aaaf (patch) | |
tree | ae77fd8618870614cb1380e2bc10eff57f602e06 /util | |
parent | c0d24e7f70816c8af51ebe9dc74aa276a81858dd (diff) | |
download | qemu-33bef0b9948b85000221d32c758d9d4a9276aaaf.zip qemu-33bef0b9948b85000221d32c758d9d4a9276aaaf.tar.gz qemu-33bef0b9948b85000221d32c758d9d4a9276aaaf.tar.bz2 |
qemu-timer: fix off-by-one
If the first timer is exactly at the current value of the clock, the
deadline is met and the timer should fire. This fixes itself on the next
iteration of the loop without icount; with icount, however, execution
of instructions will stop exactly at the deadline and won't proceed.
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'util')
-rw-r--r-- | util/qemu-timer.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/util/qemu-timer.c b/util/qemu-timer.c index 6cf70b9..2f20151 100644 --- a/util/qemu-timer.c +++ b/util/qemu-timer.c @@ -199,7 +199,7 @@ bool timerlist_expired(QEMUTimerList *timer_list) expire_time = timer_list->active_timers->expire_time; qemu_mutex_unlock(&timer_list->active_timers_lock); - return expire_time < qemu_clock_get_ns(timer_list->clock->type); + return expire_time <= qemu_clock_get_ns(timer_list->clock->type); } bool qemu_clock_expired(QEMUClockType type) |