Received: from eggs.gnu.org ([2001:4830:134:3::10]:49168) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aHJWB-0008Sw-NR for qemu-devel@nongnu.org; Thu, 07 Jan 2016 17:58:59 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aHJWA-0004Ak-SS for qemu-devel@nongnu.org; Thu, 07 Jan 2016 17:58:55 -0500 From: Max Reitz Date: Thu, 7 Jan 2016 23:57:33 +0100 Message-Id: <1452207455-10806-20-git-send-email-mreitz@redhat.com> In-Reply-To: <1452207455-10806-1-git-send-email-mreitz@redhat.com> References: <1452207455-10806-1-git-send-email-mreitz@redhat.com> Subject: [Qemu-devel] [PULL 19/21] block: Add check on mirror target List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-block@nongnu.org Cc: Fam Zheng , qemu-devel@nongnu.org, Max Reitz From: Fam Zheng 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 --- blockdev.c | 3 +++ include/block/block.h | 1 + 2 files changed, 4 insertions(+) diff --git a/blockdev.c b/blockdev.c index 22e06ba..f42e171 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 8ea12fa..c96923d 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, -- 2.6.4