]> git.proxmox.com Git - qemu.git/commit
qemu-timer: do not take the lock in timer_pending
authorPaolo Bonzini <pbonzini@redhat.com>
Thu, 12 Sep 2013 09:02:20 +0000 (11:02 +0200)
committerStefan Hajnoczi <stefanha@redhat.com>
Wed, 18 Sep 2013 13:48:33 +0000 (15:48 +0200)
commit3db1ee7c2af2fbbfe259712e3ce74158bc667ad3
treee251ed3d3324e051c0ff37aa929f3b33dd5f9e3a
parent978f2205c791de0e02c8802a645bea657408abfd
qemu-timer: do not take the lock in timer_pending

We can deduce the result from expire_time, by making it always -1 if
the timer is not in the active_timers list.  We need to check against
negative times passed to timer_mod_ns; clamping them to zero is not
a problem because the only clock that has a zero value at VM startup
is QEMU_CLOCK_VIRTUAL, and it is monotonic so it cannot be non-zero.
QEMU_CLOCK_HOST, instead, is not monotonic but it cannot go to negative
values unless the host time is seriously screwed up and points to
the 1960s.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
qemu-timer.c