diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2011-04-13 10:03:46 +0200 |
---|---|---|
committer | Edgar E. Iglesias <edgar.iglesias@gmail.com> | 2011-04-15 09:27:56 +0200 |
commit | cb842c90a485d9dbf05fa51e1500b3c1a1931256 (patch) | |
tree | 8d79ce50b0e1bbc0548c9584936ca565be75f410 /qemu-timer.c | |
parent | 1ece93a91b8435b815ce7214cf41bbbbe7929e8b (diff) | |
download | hqemu-cb842c90a485d9dbf05fa51e1500b3c1a1931256.zip hqemu-cb842c90a485d9dbf05fa51e1500b3c1a1931256.tar.gz |
qemu_next_deadline should not consider host-time timers
It is purely for icount-based virtual timers. And now that we got the
code right, rename the function to clarify the intended scope.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Tested-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
Diffstat (limited to 'qemu-timer.c')
-rw-r--r-- | qemu-timer.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/qemu-timer.c b/qemu-timer.c index 7998f37..b8c0c88 100644 --- a/qemu-timer.c +++ b/qemu-timer.c @@ -452,7 +452,7 @@ void qemu_clock_warp(QEMUClock *clock) } vm_clock_warp_start = qemu_get_clock_ns(rt_clock); - deadline = qemu_next_deadline(); + deadline = qemu_next_icount_deadline(); if (deadline > 0) { /* * Ensure the vm_clock proceeds even when the virtual CPU goes to @@ -765,21 +765,16 @@ static void host_alarm_handler(int host_signum) } } -int64_t qemu_next_deadline(void) +int64_t qemu_next_icount_deadline(void) { /* To avoid problems with overflow limit this to 2^32. */ int64_t delta = INT32_MAX; + assert(use_icount); if (active_timers[QEMU_CLOCK_VIRTUAL]) { delta = active_timers[QEMU_CLOCK_VIRTUAL]->expire_time - qemu_get_clock_ns(vm_clock); } - if (active_timers[QEMU_CLOCK_HOST]) { - int64_t hdelta = active_timers[QEMU_CLOCK_HOST]->expire_time - - qemu_get_clock_ns(host_clock); - if (hdelta < delta) - delta = hdelta; - } if (delta < 0) delta = 0; @@ -1169,7 +1164,7 @@ int qemu_calculate_timeout(void) } else { /* Wait for either IO to occur or the next timer event. */ - add = qemu_next_deadline(); + add = qemu_next_icount_deadline(); /* We advance the timer before checking for IO. Limit the amount we advance so that early IO activity won't get the guest too far ahead. */ |