Re: [Qemu-block] [PATCH] block: Let bdrv_drain_all() to call aio_poll() for each AioContext

2015-05-14 Thread Paolo Bonzini
On 13/05/2015 18:34, Alexander Yarygin wrote: Ah, right. We need second loop, something like this: @@ -2030,20 +2033,33 @@ void bdrv_drain(BlockDriverState *bs) void bdrv_drain_all(void) { /* Always run first iteration so any pending completion BHs run */ -bool busy = true; +

[Qemu-block] [PATCH] block: Let bdrv_drain_all() to call aio_poll() for each AioContext

2015-05-13 Thread Alexander Yarygin
After the commit 9b536adc (block: acquire AioContext in bdrv_drain_all()) the aio_poll() function got called for every BlockDriverState, in assumption that every device may have its own AioContext. The bdrv_drain_all() function is called in each virtio_reset() call, which in turn is called for

Re: [Qemu-block] [PATCH] block: Let bdrv_drain_all() to call aio_poll() for each AioContext

2015-05-13 Thread Alexander Yarygin
Paolo Bonzini pbonz...@redhat.com writes: On 13/05/2015 17:18, Alexander Yarygin wrote: After the commit 9b536adc (block: acquire AioContext in bdrv_drain_all()) the aio_poll() function got called for every BlockDriverState, in assumption that every device may have its own AioContext. The

Re: [Qemu-block] [PATCH] block: Let bdrv_drain_all() to call aio_poll() for each AioContext

2015-05-13 Thread Alexander Yarygin
Alberto Garcia be...@igalia.com writes: On Wed 13 May 2015 05:18:31 PM CEST, Alexander Yarygin yary...@linux.vnet.ibm.com wrote: +if (!aio_ctxs || !g_list_find(aio_ctxs, aio_context)) { +busy |= aio_poll(aio_context, busy); +aio_ctxs =