Am 29.03.2013 um 00:37 hat Paolo Bonzini geschrieben: > Il 28/03/2013 22:52, Anthony Liguori ha scritto: > > Today, all callers of qemu_aio_set_fd_handler() pass a valid io_flush > > function. > > Except one: > > aio_set_event_notifier(ctx, &ctx->notifier, > (EventNotifierHandler *) > event_notifier_test_and_clear, NULL); > > This is the EventNotifier that is used by qemu_notify_event. > > It's quite surprising that this patch works and passes the tests. /me > reads cover letter... ah, it is untested. :) > > But if you can eliminate the sole usage of aio_wait()'s return value (in > bdrv_drain_all()), everything would be much simpler. There is a > relatively convenient > > assert(QLIST_EMPTY(&bs->tracked_requests)); > > that you can use as the exit condition instead. Perhaps it's not > trivial to do it efficiently, but it's not a fast path.
We just need to move to .bdrv_drain() for all block driver that register an AioHandler. I'm pretty sure that each one has its own data structures to manage in-flight requests (basically what is the aio_flush handler today would become the .bdrv_drain callback). Then bdrv_drain_all() can directly use the bdrv_drain() return value and doesn't need to have it passed through aio_wait() any more. Kevin