From: Fam Zheng Date: Thu, 24 Dec 2015 04:45:04 +0000 (+0800) Subject: block: Add check on mirror target X-Git-Tag: v2.6.0-rc0~239^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e40e5027f6b0b7e981c4f1844180fb0e7947d1cd;p=thirdparty%2Fqemu.git block: Add check on mirror target Signed-off-by: Fam Zheng Reviewed-by: Max Reitz Message-id: 1450932306-13717-4-git-send-email-famz@redhat.com Signed-off-by: Max Reitz --- diff --git a/blockdev.c b/blockdev.c index 22e06ba75e0..f42e1713e9c 100644 --- a/blockdev.c +++ b/blockdev.c @@ -3342,6 +3342,9 @@ static void blockdev_mirror_common(BlockDriverState *bs, if (bdrv_op_is_blocked(bs, BLOCK_OP_TYPE_MIRROR_SOURCE, errp)) { return; } + if (bdrv_op_is_blocked(target, BLOCK_OP_TYPE_MIRROR_TARGET, errp)) { + return; + } if (!bs->backing && sync == MIRROR_SYNC_MODE_TOP) { sync = MIRROR_SYNC_MODE_FULL; diff --git a/include/block/block.h b/include/block/block.h index 8ea12fa2221..c96923df99a 100644 --- a/include/block/block.h +++ b/include/block/block.h @@ -170,6 +170,7 @@ typedef enum BlockOpType { BLOCK_OP_TYPE_INTERNAL_SNAPSHOT, BLOCK_OP_TYPE_INTERNAL_SNAPSHOT_DELETE, BLOCK_OP_TYPE_MIRROR_SOURCE, + BLOCK_OP_TYPE_MIRROR_TARGET, BLOCK_OP_TYPE_RESIZE, BLOCK_OP_TYPE_STREAM, BLOCK_OP_TYPE_REPLACE,