On Thu, Jun 27, 2013 at 03:13:19PM +0200, Paolo Bonzini wrote: > Il 14/06/2013 13:43, Stefan Hajnoczi ha scritto: > > If a block driver has no file descriptors to monitor but there are still > > active requests, it can return 1 from .io_flush(). This is used to spin > > during synchronous I/O. > > > > Stop relying on .io_flush() and instead check > > QLIST_EMPTY(&bs->tracked_requests) to decide whether there are active > > requests. > > > > This is the first step in removing .io_flush() so that event loops no > > longer need to have the concept of synchronous I/O. Eventually we may > > be able to kill synchronous I/O completely by running everything in a > > coroutine, but that is future work. > > > > Note this patch moves bs->throttled_reqs initialization to bdrv_new() so > > that bdrv_requests_pending(bs) can safely access it. In practice bs is > > g_malloc0() so the memory is already zeroed but it's safer to initialize > > the queue properly. > > > > In bdrv_delete() make sure to call bdrv_make_anon() *after* bdrv_close() > > so that the device is still seen by bdrv_drain_all() when iterating > > bdrv_states. > > I wonder if this last change should be separated out and CCed to > qemu-stable. It seems like a bug if you close a device that has pending > throttled operations.
Seems like a good idea. I'll send the next version with a separated Cc: qemu-sta...@nongnu.org patch. Stefan