aboutsummaryrefslogtreecommitdiff
path: root/block/qapi-sysemu.c
diff options
context:
space:
mode:
Diffstat (limited to 'block/qapi-sysemu.c')
-rw-r--r--block/qapi-sysemu.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/block/qapi-sysemu.c b/block/qapi-sysemu.c
index 3f614cb..1618cd2 100644
--- a/block/qapi-sysemu.c
+++ b/block/qapi-sysemu.c
@@ -237,6 +237,7 @@ static void qmp_blockdev_insert_anon_medium(BlockBackend *blk,
BlockDriverState *bs, Error **errp)
{
Error *local_err = NULL;
+ AioContext *ctx;
bool has_device;
int ret;
@@ -258,7 +259,11 @@ static void qmp_blockdev_insert_anon_medium(BlockBackend *blk,
return;
}
+ ctx = bdrv_get_aio_context(bs);
+ aio_context_acquire(ctx);
ret = blk_insert_bs(blk, bs, errp);
+ aio_context_release(ctx);
+
if (ret < 0) {
return;
}