summaryrefslogtreecommitdiff
path: root/blockdev.c
diff options
context:
space:
mode:
authorFam Zheng <famz@redhat.com>2015-12-24 12:45:04 +0800
committerMax Reitz <mreitz@redhat.com>2016-01-07 21:30:18 +0100
commite40e5027f6b0b7e981c4f1844180fb0e7947d1cd (patch)
tree99bbad7dff41c869899f7523709757cac838e5a1 /blockdev.c
parent4193cdd7718e69589af82aca44c39266e753af14 (diff)
block: Add check on mirror target
Signed-off-by: Fam Zheng <famz@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Message-id: 1450932306-13717-4-git-send-email-famz@redhat.com Signed-off-by: Max Reitz <mreitz@redhat.com>
Diffstat (limited to 'blockdev.c')
-rw-r--r--blockdev.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/blockdev.c b/blockdev.c
index 22e06ba75e..f42e1713e9 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;