Not sure if this is correct, but at least it makes qemu-iotests 127 pass
again.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
block/io.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/block/io.c b/block/io.c
index 832d2536bf..d3dde4d7fd 100644
--- a/block/io.c
+++ b/block/io.c
@@ -309,6 +309,10 @@ static void bdrv_co_drain_bh_cb(void *opaque)
BdrvCoDrainData *data = opaque;
Coroutine *co = data->co;
BlockDriverState *bs = data->bs;
+ AioContext *ctx;
+
+ ctx = bdrv_get_aio_context(bs);
+ aio_context_acquire(ctx);
if (bs) {
bdrv_dec_in_flight(bs);
@@ -324,6 +328,8 @@ static void bdrv_co_drain_bh_cb(void *opaque)
bdrv_drain_all_begin();
}
+ aio_context_release(ctx);
+
data->done = true;
aio_co_wake(co);
}
--
2.13.6