@@ -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);
@@ -2197,7 +2197,8 @@
# @mode: the replication mode
#
# @top-id: #optional In secondary mode, node name or device ID of the root
-# node who owns the replication node chain. Ignored in primary mode.
+# node who owns the replication node chain. Must not be given in
+# primary mode.
#
# Since: 2.8
##