From d861ab3acf8dcf817e0c2335979b258847b69564 Mon Sep 17 00:00:00 2001 From: Kevin Wolf Date: Thu, 25 Apr 2019 14:25:10 +0200 Subject: block: Add BlockBackend.ctx This adds a new parameter to blk_new() which requires its callers to declare from which AioContext this BlockBackend is going to be used (or the locks of which AioContext need to be taken anyway). The given context is only stored and kept up to date when changing AioContexts. Actually applying the stored AioContext to the root node is saved for another commit. Signed-off-by: Kevin Wolf --- qemu-img.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'qemu-img.c') diff --git a/qemu-img.c b/qemu-img.c index b0535919b1..07b6e2a808 100644 --- a/qemu-img.c +++ b/qemu-img.c @@ -3313,7 +3313,8 @@ static int img_rebase(int argc, char **argv) BlockDriverState *base_bs = backing_bs(bs); if (base_bs) { - blk_old_backing = blk_new(BLK_PERM_CONSISTENT_READ, + blk_old_backing = blk_new(qemu_get_aio_context(), + BLK_PERM_CONSISTENT_READ, BLK_PERM_ALL); ret = blk_insert_bs(blk_old_backing, base_bs, &local_err); @@ -3360,7 +3361,8 @@ static int img_rebase(int argc, char **argv) prefix_chain_bs = bdrv_find_backing_image(bs, out_real_path); if (prefix_chain_bs) { g_free(out_real_path); - blk_new_backing = blk_new(BLK_PERM_CONSISTENT_READ, + blk_new_backing = blk_new(qemu_get_aio_context(), + BLK_PERM_CONSISTENT_READ, BLK_PERM_ALL); ret = blk_insert_bs(blk_new_backing, prefix_chain_bs, &local_err); -- cgit v1.2.3