summaryrefslogtreecommitdiff
path: root/qemu-timer.c
diff options
context:
space:
mode:
authorAlex Bligh <alex@alex.org.uk>2013-08-21 16:02:55 +0100
committerStefan Hajnoczi <stefanha@redhat.com>2013-08-22 19:10:28 +0200
commitb1bbfe72ec1ebf302d97f886cc646466c0abd679 (patch)
tree12c6814d68c6b4cad6fa45bbb0d9f88569914722 /qemu-timer.c
parent7b595f35d89d73bc69c35bf3980a89c420e8a44b (diff)
aio / timers: On timer modification, qemu_notify or aio_notify
On qemu_mod_timer_ns, ensure qemu_notify or aio_notify is called to end the appropriate poll(), irrespective of use_icount value. On qemu_clock_enable, ensure qemu_notify or aio_notify is called for all QEMUTimerLists attached to the QEMUClock. Signed-off-by: Alex Bligh <alex@alex.org.uk> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'qemu-timer.c')
-rw-r--r--qemu-timer.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/qemu-timer.c b/qemu-timer.c
index ffdc28a264..746ba8b7e1 100644
--- a/qemu-timer.c
+++ b/qemu-timer.c
@@ -304,11 +304,20 @@ bool qemu_clock_use_for_deadline(QEMUClock *clock)
return !(use_icount && (clock->type == QEMU_CLOCK_VIRTUAL));
}
+void qemu_clock_notify(QEMUClock *clock)
+{
+ QEMUTimerList *timer_list;
+ QLIST_FOREACH(timer_list, &clock->timerlists, list) {
+ timerlist_notify(timer_list);
+ }
+}
+
void qemu_clock_enable(QEMUClock *clock, bool enabled)
{
bool old = clock->enabled;
clock->enabled = enabled;
if (enabled && !old) {
+ qemu_clock_notify(clock);
qemu_rearm_alarm_timer(alarm_timer);
}
}
@@ -522,9 +531,7 @@ void qemu_mod_timer_ns(QEMUTimer *ts, int64_t expire_time)
}
/* Interrupt execution to force deadline recalculation. */
qemu_clock_warp(ts->timer_list->clock);
- if (use_icount) {
- timerlist_notify(ts->timer_list);
- }
+ timerlist_notify(ts->timer_list);
}
}