block: Defer .bdrv_drain_begin callback to polling phase
commit0109e7e6f83ae5166b81bbd9a4319d60be49985a
authorKevin Wolf <kwolf@redhat.com>
Fri, 23 Mar 2018 19:29:24 +0000 (23 20:29 +0100)
committerKevin Wolf <kwolf@redhat.com>
Mon, 18 Jun 2018 13:03:25 +0000 (18 15:03 +0200)
tree2e857bee2d5554f969a1c06ad359bf2495cc2624
parent231281ab42dad2b407b941e36ad11cbc6586e937
block: Defer .bdrv_drain_begin callback to polling phase

We cannot allow aio_poll() in bdrv_drain_invoke(begin=true) until we're
done with propagating the drain through the graph and are doing the
single final BDRV_POLL_WHILE().

Just schedule the coroutine with the callback and increase bs->in_flight
to make sure that the polling phase will wait for it.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block/io.c