[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [RFC] [PATCHv8 16/30] aio / timers: On timer modificati
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [RFC] [PATCHv8 16/30] aio / timers: On timer modification, qemu_notify or aio_notify |
Date: |
Fri, 09 Aug 2013 12:08:55 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130625 Thunderbird/17.0.7 |
Il 08/08/2013 23:42, Alex Bligh ha scritto:
> 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>
Reviewed-by: Paolo Bonzini <address@hidden>
> ---
> include/qemu/timer.h | 9 +++++++++
> qemu-timer.c | 13 ++++++++++---
> 2 files changed, 19 insertions(+), 3 deletions(-)
>
> diff --git a/include/qemu/timer.h b/include/qemu/timer.h
> index 07e6d9e..68f76df 100644
> --- a/include/qemu/timer.h
> +++ b/include/qemu/timer.h
> @@ -122,6 +122,15 @@ bool qemu_clock_use_for_deadline(QEMUClock *clock);
> QEMUTimerList *qemu_clock_get_main_loop_timerlist(QEMUClock *clock);
>
> /**
> + * qemu_clock_nofify:
> + * @clock: the clock to operate on
> + *
> + * Call the notifier callback connected with the default timer
> + * list linked to the clock, or qemu_notify() if none.
> + */
> +void qemu_clock_notify(QEMUClock *clock);
> +
> +/**
> * timerlist_new:
> * @type: the clock type to associate with the timerlist
> *
> diff --git a/qemu-timer.c b/qemu-timer.c
> index 14cb433..4b162e1 100644
> --- a/qemu-timer.c
> +++ b/qemu-timer.c
> @@ -307,11 +307,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);
> }
> }
> @@ -535,9 +544,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);
> }
> }
>
>
- Re: [Qemu-devel] [RFC] [PATCHv8 12/30] aio / timers: aio_ctx_prepare sets timeout from AioContext timers, (continued)
- [Qemu-devel] [RFC] [PATCHv8 13/30] aio / timers: Add aio_timer_new wrapper, Alex Bligh, 2013/08/08
- [Qemu-devel] [RFC] [PATCHv8 08/30] aio / timers: Untangle include files, Alex Bligh, 2013/08/08
- [Qemu-devel] [RFC] [PATCHv8 14/30] aio / timers: Convert aio_poll to use AioContext timers' deadline, Alex Bligh, 2013/08/08
- [Qemu-devel] [RFC] [PATCHv8 07/30] aio / timers: Split QEMUClock into QEMUClock and QEMUTimerList, Alex Bligh, 2013/08/08
- [Qemu-devel] [RFC] [PATCHv8 15/30] aio / timers: Convert mainloop to use timeout, Alex Bligh, 2013/08/08
- [Qemu-devel] [RFC] [PATCHv8 16/30] aio / timers: On timer modification, qemu_notify or aio_notify, Alex Bligh, 2013/08/08
- Re: [Qemu-devel] [RFC] [PATCHv8 16/30] aio / timers: On timer modification, qemu_notify or aio_notify,
Paolo Bonzini <=
- [Qemu-devel] [RFC] [PATCHv8 17/30] aio / timers: Introduce new API qemu_timer_new and friends, Alex Bligh, 2013/08/08
- [Qemu-devel] [RFC] [PATCHv8 18/30] aio / timers: Use all timerlists in icount warp calculations, Alex Bligh, 2013/08/08
- [Qemu-devel] [RFC] [PATCHv8 20/30] aio / timers: Remove alarm timers, Alex Bligh, 2013/08/08
- [Qemu-devel] [RFC] [PATCHv8 19/30] aio / timers: Add documentation and new format calls, Alex Bligh, 2013/08/08
- [Qemu-devel] [RFC] [PATCHv8 22/30] aio / timers: Add qemu_clock_get_ms and qemu_clock_get_ms, Alex Bligh, 2013/08/08
- [Qemu-devel] [RFC] [PATCHv8 21/30] aio / timers: Remove legacy qemu_clock_deadline & qemu_timerlist_deadline, Alex Bligh, 2013/08/08
- [Qemu-devel] [RFC] [PATCHv8 24/30] aio / timers: Remove main_loop_timerlist, Alex Bligh, 2013/08/08
- [Qemu-devel] [RFC] [PATCHv8 26/30] aio / timers: convert block_job_sleep_ns and co_sleep_ns to new API, Alex Bligh, 2013/08/08
- [Qemu-devel] [RFC] [PATCHv8 25/30] aio / timers: Convert rtc_clock to be a QEMUClockType, Alex Bligh, 2013/08/08
- [Qemu-devel] [RFC] [PATCHv8 27/30] aio / timers: Add test harness for AioContext timers, Alex Bligh, 2013/08/08