From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55400) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1byieJ-0003op-Fj for qemu-devel@nongnu.org; Mon, 24 Oct 2016 13:03:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1byieF-0005He-MA for qemu-devel@nongnu.org; Mon, 24 Oct 2016 13:02:59 -0400 From: Kevin Wolf Date: Mon, 24 Oct 2016 19:02:11 +0200 Message-Id: <1477328531-30879-24-git-send-email-kwolf@redhat.com> In-Reply-To: <1477328531-30879-1-git-send-email-kwolf@redhat.com> References: <1477328531-30879-1-git-send-email-kwolf@redhat.com> Subject: [Qemu-devel] [PULL 23/23] block/replication: Clarify 'top-id' parameter usage List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-block@nongnu.org Cc: kwolf@redhat.com, qemu-devel@nongnu.org From: Changlong Xie 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 Signed-off-by: Changlong Xie Message-id: 1476247808-15646-1-git-send-email-xiecl.fnst@cn.fujitsu.com Signed-off-by: Max Reitz --- block/replication.c | 5 +++++ qapi/block-core.json | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) 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); diff --git a/qapi/block-core.json b/qapi/block-core.json index c59047b..97b1205 100644 --- a/qapi/block-core.json +++ b/qapi/block-core.json @@ -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 ## -- 1.8.3.1