Stefan, --On 17 July 2013 11:02:30 +0800 Stefan Hajnoczi <stefa...@gmail.com> wrote:
The steps to achieving this: 1. Drop alarm timers from qemu-timer.c and calculate g_poll() timeout instead for the main loop. 2. Introduce a per-AioContext aio_ctx_clock that can be used with qemu_new_timer() to create a QEMUTimer that expires during aio_poll(). 3. Calculate g_poll() timeout for aio_ctx_clock in aio_poll().
A couple of questions: 1. How would this work where the user has no main loop, e.g. qemu-img? A block driver may well still need timers. 2. Are we guaranteed that no aio_poll user can repeatedly call aio_poll without exiting to the main loop? 3. Is it safe to anything you can do in a bh in a timer? IE are users every going to need to schedule a bh from a timer? If so, this seems a bit long winded for users that want bh functionality. The timed bh solution (which I'm by no means set on) can use any QEMUClock in the bh, so you get to choose the clock per BH, not per AioContext, which may or may not have advantages. -- Alex Bligh