aboutsummaryrefslogtreecommitdiff
path: root/block
diff options
context:
space:
mode:
authorChanglong Xie <xiecl.fnst@cn.fujitsu.com>2016-10-12 12:50:08 +0800
committerMax Reitz <mreitz@redhat.com>2016-10-24 17:56:07 +0200
commitf4f2539bcf2d41f96d7e60c4c7e81ecdf5d81c63 (patch)
treeae90b95ea95890d41acd9b60518fc37471880dec /block
parent6d3f4049ba532b01ff738f9e5a66df1477c5ffdd (diff)
downloadqemu-f4f2539bcf2d41f96d7e60c4c7e81ecdf5d81c63.zip
qemu-f4f2539bcf2d41f96d7e60c4c7e81ecdf5d81c63.tar.gz
qemu-f4f2539bcf2d41f96d7e60c4c7e81ecdf5d81c63.tar.bz2
block/replication: Clarify 'top-id' parameter usage
The replication driver only supports the 'top-id' parameter for the secondary side; it must not be supplied for the primary side. Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Changlong Xie <xiecl.fnst@cn.fujitsu.com> Message-id: 1476247808-15646-1-git-send-email-xiecl.fnst@cn.fujitsu.com Signed-off-by: Max Reitz <mreitz@redhat.com>
Diffstat (limited to 'block')
-rw-r--r--block/replication.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/block/replication.c b/block/replication.c
index 3bd1cf1..8bbfc8f 100644
--- a/block/replication.c
+++ b/block/replication.c
@@ -101,6 +101,11 @@ static int replication_open(BlockDriverState *bs, QDict *options,
if (!strcmp(mode, "primary")) {
s->mode = REPLICATION_MODE_PRIMARY;
+ top_id = qemu_opt_get(opts, REPLICATION_TOP_ID);
+ if (top_id) {
+ error_setg(&local_err, "The primary side does not support option top-id");
+ goto fail;
+ }
} else if (!strcmp(mode, "secondary")) {
s->mode = REPLICATION_MODE_SECONDARY;
top_id = qemu_opt_get(opts, REPLICATION_TOP_ID);