* [Qemu-devel] [PATCH v3] block/replication: Clarify 'top-id' parameter usage
@ 2016-10-12 4:50 Changlong Xie
2016-10-21 20:37 ` Max Reitz
0 siblings, 1 reply; 2+ messages in thread
From: Changlong Xie @ 2016-10-12 4:50 UTC (permalink / raw)
To: qemu devel, qemu block, Stefan Hajnoczi, Fam Zheng, Max Reitz,
Kevin Wolf, Eric Blake, Wen Congyang
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>
---
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 1b7aa1b..74b5c69 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.9.3
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [Qemu-devel] [PATCH v3] block/replication: Clarify 'top-id' parameter usage
2016-10-12 4:50 [Qemu-devel] [PATCH v3] block/replication: Clarify 'top-id' parameter usage Changlong Xie
@ 2016-10-21 20:37 ` Max Reitz
0 siblings, 0 replies; 2+ messages in thread
From: Max Reitz @ 2016-10-21 20:37 UTC (permalink / raw)
To: Changlong Xie, qemu devel, qemu block, Stefan Hajnoczi,
Fam Zheng, Kevin Wolf, Eric Blake, Wen Congyang
[-- Attachment #1: Type: text/plain, Size: 529 bytes --]
On 12.10.2016 06:50, Changlong Xie wrote:
> 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>
> ---
> block/replication.c | 5 +++++
> qapi/block-core.json | 3 ++-
> 2 files changed, 7 insertions(+), 1 deletion(-)
Thanks, I've applied the patch to my block branch:
https://github.com/XanClic/qemu/commits/block
Max
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 480 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-10-21 20:37 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-12 4:50 [Qemu-devel] [PATCH v3] block/replication: Clarify 'top-id' parameter usage Changlong Xie
2016-10-21 20:37 ` Max Reitz
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.