Skip to content
  • Paolo Bonzini's avatar
    qemu-timer: do not take the lock in timer_pending · 3db1ee7c
    Paolo Bonzini authored
    
    
    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: default avatarPaolo Bonzini <pbonzini@redhat.com>
    Signed-off-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
    3db1ee7c