Il 09/08/2013 16:30, Alex Bligh ha scritto: > > On 9 Aug 2013, at 11:04, Paolo Bonzini wrote: > >>> @@ -180,7 +189,7 @@ aio_ctx_check(GSource *source) >>> return true; >>> } >>> } >>> - return aio_pending(ctx); >>> + return aio_pending(ctx) || (timerlistgroup_deadline_ns(ctx->tlg) == 0); >> >> Again, if we do the "two AioContext" tricks, the >> timerlistgroup_deadline_ns function would be internal to AioContext. > > I don't think that's true as I think we'd still want to encapsulate > walking the array of clocks within qemu-timer.c.
It would just be these five lines of code, no? for (type = 0; type < QEMU_CLOCK_MAX; type++) { if (qemu_clock_use_for_deadline(qemu_clock_ptr(type))) { deadline = qemu_soonest_timeout(deadline, timerlist_deadline_ns(ctx->timerlist[type])); } } I'm not sure if it is a worthwhile to keep 80 lines of code just to abstract a single loop. Paolo