From: sochin.jiang Date: Mon, 26 Jun 2017 11:04:24 +0000 (+0800) Subject: mirror: Fix inconsistent backing AioContext for after mirroring X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=5ce6bfe255091d532ec4555d0ede816294cb1703;p=qemu.git mirror: Fix inconsistent backing AioContext for after mirroring mirror_complete opens the backing chain, which should have the same AioContext as the top when using iothreads. Make the code guarantee this, which fixes a failed assertion in bdrv_attach_child. Signed-off-by: sochin.jiang Message-id: 1498475064-39816-1-git-send-email-sochin.jiang@huawei.com [mreitz: Reworded commit message] Signed-off-by: Max Reitz --- diff --git a/block.c b/block.c index edfa6b7a2c..b9e5114a27 100644 --- a/block.c +++ b/block.c @@ -2185,6 +2185,7 @@ int bdrv_open_backing_file(BlockDriverState *bs, QDict *parent_options, ret = -EINVAL; goto free_exit; } + bdrv_set_aio_context(backing_hd, bdrv_get_aio_context(bs)); /* Hook up the backing file link; drop our reference, bs owns the * backing_hd reference now */