Il 17/07/2013 10:07, Alex Bligh ha scritto: > 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.
The block driver should only use aio_ctx_clock, and those _would_ be handled in aio_poll(). > 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. It is safe. Paolo