[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [RFC] [PATCHv5 13/16] aio / timers: On timer modification,
From: |
Alex Bligh |
Subject: |
[Qemu-devel] [RFC] [PATCHv5 13/16] aio / timers: On timer modification, qemu_notify or aio_notify |
Date: |
Sun, 4 Aug 2013 19:10:02 +0100 |
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 <address@hidden>
---
include/qemu/timer.h | 1 +
qemu-timer.c | 13 ++++++++++---
2 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/include/qemu/timer.h b/include/qemu/timer.h
index 970042d..0a02a17 100644
--- a/include/qemu/timer.h
+++ b/include/qemu/timer.h
@@ -62,6 +62,7 @@ int64_t qemu_clock_deadline(QEMUClock *clock);
int64_t qemu_clock_deadline_ns(QEMUClock *clock);
bool qemu_clock_use_for_deadline(QEMUClock *clock);
QEMUTimerList *qemu_clock_get_default_timerlist(QEMUClock *clock);
+void qemu_clock_notify(QEMUClock *clock);
QEMUTimerList *timerlist_new(QEMUClockType type);
void timerlist_free(QEMUTimerList *tl);
diff --git a/qemu-timer.c b/qemu-timer.c
index 4562c70..789bb77 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 *tl;
+ QLIST_FOREACH(tl, &clock->timerlists, list) {
+ timerlist_notify(tl);
+ }
+}
+
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);
}
}
@@ -529,9 +538,7 @@ void qemu_mod_timer_ns(QEMUTimer *ts, int64_t expire_time)
}
/* Interrupt execution to force deadline recalculation. */
qemu_clock_warp(ts->tl->clock);
- if (use_icount) {
- timerlist_notify(ts->tl);
- }
+ timerlist_notify(ts->tl);
}
}
--
1.7.9.5
- Re: [Qemu-devel] [RFC] [PATCHv4 10/13] aio / timers: Convert mainloop to use timeout, Paolo Bonzini, 2013/08/01
- Re: [Qemu-devel] [RFC] [PATCHv4 10/13] aio / timers: Convert mainloop to use timeout, Alex Bligh, 2013/08/01
- Re: [Qemu-devel] [RFC] [PATCHv4 10/13] aio / timers: Convert mainloop to use timeout, Paolo Bonzini, 2013/08/01
- Re: [Qemu-devel] [RFC] [PATCHv4 10/13] aio / timers: Convert mainloop to use timeout, Alex Bligh, 2013/08/02
- [Qemu-devel] [RFC] [PATCHv5 00/16] aio / timers: Add AioContext timers and use ppoll, Alex Bligh, 2013/08/04
- [Qemu-devel] [RFC] [PATCHv5 01/16] aio / timers: add qemu-timer.c utility functions, Alex Bligh, 2013/08/04
- [Qemu-devel] [RFC] [PATCHv5 04/16] aio / timers: Make qemu_run_timers and qemu_run_all_timers return progress, Alex Bligh, 2013/08/04
- [Qemu-devel] [RFC] [PATCHv5 07/16] aio / timers: Add QEMUTimerListGroup and helper functions, Alex Bligh, 2013/08/04
- [Qemu-devel] [RFC] [PATCHv5 10/16] aio / timers: aio_ctx_prepare sets timeout from AioContext timers, Alex Bligh, 2013/08/04
- [Qemu-devel] [RFC] [PATCHv5 08/16] aio / timers: Add QEMUTimerListGroup to AioContext, Alex Bligh, 2013/08/04
- [Qemu-devel] [RFC] [PATCHv5 13/16] aio / timers: On timer modification, qemu_notify or aio_notify,
Alex Bligh <=
- [Qemu-devel] [RFC] [PATCHv5 12/16] aio / timers: Convert mainloop to use timeout, Alex Bligh, 2013/08/04
- [Qemu-devel] [RFC] [PATCHv5 02/16] aio / timers: add ppoll support with qemu_poll_ns, Alex Bligh, 2013/08/04
- [Qemu-devel] [RFC] [PATCHv5 11/16] aio / timers: Convert aio_poll to use AioContext timers' deadline, Alex Bligh, 2013/08/04
- [Qemu-devel] [RFC] [PATCHv5 03/16] aio / timers: Add prctl(PR_SET_TIMERSLACK, 1, ...) to reduce timer slack, Alex Bligh, 2013/08/04
- [Qemu-devel] [RFC] [PATCHv5 14/16] aio / timers: Use all timerlists in icount warp calculations, Alex Bligh, 2013/08/04
- [Qemu-devel] [RFC] [PATCHv5 05/16] aio / timers: Split QEMUClock into QEMUClock and QEMUTimerList, Alex Bligh, 2013/08/04
- [Qemu-devel] [RFC] [PATCHv5 06/16] aio / timers: Untangle include files, Alex Bligh, 2013/08/04
- Re: [Qemu-devel] [RFC] [PATCHv5 06/16] aio / timers: Untangle include files, Stefan Hajnoczi, 2013/08/06
- Re: [Qemu-devel] [RFC] [PATCHv5 06/16] aio / timers: Untangle include files, Alex Bligh, 2013/08/06
- Re: [Qemu-devel] [RFC] [PATCHv5 06/16] aio / timers: Untangle include files, Stefan Hajnoczi, 2013/08/06