All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH V8 0/2] Add new qmp commands to suppurt Xen COLO
@ 2017-02-23  7:14 Zhang Chen
  2017-02-23  7:14 ` [Qemu-devel] [PATCH V8 1/2] Add a new qmp command to start/stop replication Zhang Chen
  2017-02-23  7:14 ` [Qemu-devel] [PATCH V8 2/2] Add a new qmp command to do checkpoint, query xen replication status Zhang Chen
  0 siblings, 2 replies; 9+ messages in thread
From: Zhang Chen @ 2017-02-23  7:14 UTC (permalink / raw)
  To: qemu devel, Eric Blake, zhanghailiang, Markus Armbruster,
	Stefano Stabellini
  Cc: Jason Wang, Zhang Chen, Li Zhijian, eddie . dong, bian naimeng

Xen COLO depend on qemu COLO replication function.
So, We need new qmp commands for Xen to use qemu replication.

Corresponding libxl patches already in xen.git.
Commit ID:

ed37ef1f91c20f0ab162ce60f8c38400b917fa64
COLO: introduce new API to prepare/start/do/get_error/stop replication

a0ddc0b359375b2418213966dfbdbfab593ecc6f
tools/libxl: introduction of libxl__qmp_restore to load qemu state


note: V8 address Zhanghailiang, Eric Blake and Markus Armbruster's comments.

Zhang Chen (2):
  Add a new qmp command to start/stop replication
  Add a new qmp command to do checkpoint, query xen replication status

 migration/colo.c | 46 +++++++++++++++++++++++++++++++++++
 qapi-schema.json | 73 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 119 insertions(+)

-- 
2.7.4

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Qemu-devel] [PATCH V8 1/2] Add a new qmp command to start/stop replication
  2017-02-23  7:14 [Qemu-devel] [PATCH V8 0/2] Add new qmp commands to suppurt Xen COLO Zhang Chen
@ 2017-02-23  7:14 ` Zhang Chen
  2017-02-23 15:31   ` Eric Blake
  2017-02-23  7:14 ` [Qemu-devel] [PATCH V8 2/2] Add a new qmp command to do checkpoint, query xen replication status Zhang Chen
  1 sibling, 1 reply; 9+ messages in thread
From: Zhang Chen @ 2017-02-23  7:14 UTC (permalink / raw)
  To: qemu devel, Eric Blake, zhanghailiang, Markus Armbruster,
	Stefano Stabellini
  Cc: Jason Wang, Zhang Chen, Li Zhijian, eddie . dong, bian naimeng,
	Wen Congyang

We can call this qmp command to start/stop replication outside of qemu.
Like Xen colo need this function.

Signed-off-by: Zhang Chen <zhangchen.fnst@cn.fujitsu.com>
Signed-off-by: Wen Congyang <wencongyang@gmail.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
Reviewed-by: zhanghailiang <zhang.zhanghailiang@huawei.com>

---
 migration/colo.c | 23 +++++++++++++++++++++++
 qapi-schema.json | 25 +++++++++++++++++++++++++
 2 files changed, 48 insertions(+)

diff --git a/migration/colo.c b/migration/colo.c
index 93c85c5..6fc2ade 100644
--- a/migration/colo.c
+++ b/migration/colo.c
@@ -19,6 +19,8 @@
 #include "qemu/error-report.h"
 #include "qapi/error.h"
 #include "migration/failover.h"
+#include "replication.h"
+#include "qmp-commands.h"
 
 #define COLO_BUFFER_BASE_SIZE (4 * 1024 * 1024)
 
@@ -104,6 +106,27 @@ void colo_do_failover(MigrationState *s)
     }
 }
 
+void qmp_xen_set_replication(bool enable, bool primary,
+                             bool has_failover, bool failover,
+                             Error **errp)
+{
+    ReplicationMode mode = primary ?
+                           REPLICATION_MODE_PRIMARY :
+                           REPLICATION_MODE_SECONDARY;
+
+    if (has_failover && enable) {
+        error_setg(errp, "Parameter 'failover' is only for"
+                   " stopping replication");
+        return;
+    }
+
+    if (enable) {
+        replication_start_all(mode, errp);
+    } else {
+        replication_stop_all(failover, failover ? NULL : errp);
+    }
+}
+
 static void colo_send_message(QEMUFile *f, COLOMessage msg,
                               Error **errp)
 {
diff --git a/qapi-schema.json b/qapi-schema.json
index cbdffdd..9445b93 100644
--- a/qapi-schema.json
+++ b/qapi-schema.json
@@ -5906,6 +5906,31 @@
 { 'command': 'xen-load-devices-state', 'data': {'filename': 'str'} }
 
 ##
+# @xen-set-replication:
+#
+# Enable or disable replication.
+#
+# @enable: true to enable, false to disable.
+#
+# @primary: true for primary or false for secondary.
+#
+# @failover: #optional true to do failover, false to stop. but cannot be
+#            specified if 'enable' is true. default value is false.
+#
+# Returns: nothing.
+#
+# Example:
+#
+# -> { "execute": "xen-set-replication",
+#      "arguments": {"enable": true, "primary": false} }
+# <- { "return": {} }
+#
+# Since: 2.9
+##
+{ 'command': 'xen-set-replication',
+  'data': { 'enable': 'bool', 'primary': 'bool', '*failover' : 'bool' } }
+
+##
 # @GICCapability:
 #
 # The struct describes capability for a specific GIC (Generic
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [Qemu-devel] [PATCH V8 2/2] Add a new qmp command to do checkpoint, query xen replication status
  2017-02-23  7:14 [Qemu-devel] [PATCH V8 0/2] Add new qmp commands to suppurt Xen COLO Zhang Chen
  2017-02-23  7:14 ` [Qemu-devel] [PATCH V8 1/2] Add a new qmp command to start/stop replication Zhang Chen
@ 2017-02-23  7:14 ` Zhang Chen
  2017-02-23 15:34   ` Eric Blake
  1 sibling, 1 reply; 9+ messages in thread
From: Zhang Chen @ 2017-02-23  7:14 UTC (permalink / raw)
  To: qemu devel, Eric Blake, zhanghailiang, Markus Armbruster,
	Stefano Stabellini
  Cc: Jason Wang, Zhang Chen, Li Zhijian, eddie . dong, bian naimeng,
	Wen Congyang

We can call this qmp command to do checkpoint outside of qemu.
Xen colo will need this function.

Signed-off-by: Zhang Chen <zhangchen.fnst@cn.fujitsu.com>
Signed-off-by: Wen Congyang <wencongyang@gmail.com>
Reviewed-by: Eric Blake <eblake@redhat.com>

---
 migration/colo.c | 23 +++++++++++++++++++++++
 qapi-schema.json | 48 ++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 71 insertions(+)

diff --git a/migration/colo.c b/migration/colo.c
index 6fc2ade..8355933 100644
--- a/migration/colo.c
+++ b/migration/colo.c
@@ -127,6 +127,29 @@ void qmp_xen_set_replication(bool enable, bool primary,
     }
 }
 
+ReplicationStatus *qmp_query_xen_replication_status(Error **errp)
+{
+    Error *err = NULL;
+    ReplicationStatus *s = g_new0(ReplicationStatus, 1);
+
+    replication_get_error_all(&err);
+    if (err) {
+        s->status = true;
+        s->has_desc = true;
+        s->desc = g_strdup(error_get_pretty(err));
+    } else {
+        s->status = false;
+    }
+
+    error_free(err);
+    return s;
+}
+
+void qmp_xen_colo_do_checkpoint(Error **errp)
+{
+    replication_do_checkpoint_all(errp);
+}
+
 static void colo_send_message(QEMUFile *f, COLOMessage msg,
                               Error **errp)
 {
diff --git a/qapi-schema.json b/qapi-schema.json
index 9445b93..a89ed77 100644
--- a/qapi-schema.json
+++ b/qapi-schema.json
@@ -5931,6 +5931,54 @@
   'data': { 'enable': 'bool', 'primary': 'bool', '*failover' : 'bool' } }
 
 ##
+# @ReplicationStatus:
+#
+# The result format for 'query-xen-replication-status'.
+#
+# @status: true to error, false to normal.
+#
+# @desc: #optional the human readable error description string, when
+#        @status is 'true'.
+#
+# Since: 2.9
+##
+{ 'struct': 'ReplicationStatus',
+  'data': { 'status': 'bool', '*desc': 'str' } }
+
+##
+# @query-xen-replication-status:
+#
+# Query replication status while the vm is running.
+#
+# Returns: A @ReplicationResult objects showing the status.
+#
+# Example:
+#
+# -> { "execute": "query-xen-replication-status" }
+# <- { "return": { "status": "normal" } }
+#
+# Since: 2.9
+##
+{ 'command': 'query-xen-replication-status',
+  'returns': 'ReplicationStatus' }
+
+##
+# @xen-colo-do-checkpoint:
+#
+# Xen uses this command to notify replication to trigger a checkpoint.
+#
+# Returns: nothing.
+#
+# Example:
+#
+# -> { "execute": "xen-colo-do-checkpoint" }
+# <- { "return": {} }
+#
+# Since: 2.9
+##
+{ 'command': 'xen-colo-do-checkpoint' }
+
+##
 # @GICCapability:
 #
 # The struct describes capability for a specific GIC (Generic
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [Qemu-devel] [PATCH V8 1/2] Add a new qmp command to start/stop replication
  2017-02-23  7:14 ` [Qemu-devel] [PATCH V8 1/2] Add a new qmp command to start/stop replication Zhang Chen
@ 2017-02-23 15:31   ` Eric Blake
  2017-02-24  3:56     ` Zhang Chen
  0 siblings, 1 reply; 9+ messages in thread
From: Eric Blake @ 2017-02-23 15:31 UTC (permalink / raw)
  To: Zhang Chen, qemu devel, zhanghailiang, Markus Armbruster,
	Stefano Stabellini
  Cc: Jason Wang, Li Zhijian, eddie . dong, bian naimeng, Wen Congyang

[-- Attachment #1: Type: text/plain, Size: 1775 bytes --]

On 02/23/2017 01:14 AM, Zhang Chen wrote:
> We can call this qmp command to start/stop replication outside of qemu.
> Like Xen colo need this function.
> 
> Signed-off-by: Zhang Chen <zhangchen.fnst@cn.fujitsu.com>
> Signed-off-by: Wen Congyang <wencongyang@gmail.com>
> Reviewed-by: Eric Blake <eblake@redhat.com>
> Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
> Reviewed-by: zhanghailiang <zhang.zhanghailiang@huawei.com>
> 
> ---

> @@ -104,6 +106,27 @@ void colo_do_failover(MigrationState *s)
>      }
>  }
>  
> +void qmp_xen_set_replication(bool enable, bool primary,
> +                             bool has_failover, bool failover,
> +                             Error **errp)
> +{
> +    ReplicationMode mode = primary ?
> +                           REPLICATION_MODE_PRIMARY :
> +                           REPLICATION_MODE_SECONDARY;
> +
> +    if (has_failover && enable) {
> +        error_setg(errp, "Parameter 'failover' is only for"
> +                   " stopping replication");
> +        return;
> +    }
> +
> +    if (enable) {
> +        replication_start_all(mode, errp);
> +    } else {
> +        replication_stop_all(failover, failover ? NULL : errp);

Technically, this is use of failover without first checking
has_failover; it would be safer if you inserted:

if (!has_failover) {
    failover = NULL;
}

earlier in the function to be safe against any callers that don't go
through the QAPI-generated code.  Fortunately, our QAPI generated code
guarantees that failover is NULL when has_failover is false, so my R-b
can stand as-is if there is no other reason for a respin.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [Qemu-devel] [PATCH V8 2/2] Add a new qmp command to do checkpoint, query xen replication status
  2017-02-23  7:14 ` [Qemu-devel] [PATCH V8 2/2] Add a new qmp command to do checkpoint, query xen replication status Zhang Chen
@ 2017-02-23 15:34   ` Eric Blake
  2017-02-24  5:33     ` Zhang Chen
  2017-03-03 13:45     ` Markus Armbruster
  0 siblings, 2 replies; 9+ messages in thread
From: Eric Blake @ 2017-02-23 15:34 UTC (permalink / raw)
  To: Zhang Chen, qemu devel, zhanghailiang, Markus Armbruster,
	Stefano Stabellini
  Cc: Jason Wang, Li Zhijian, eddie . dong, bian naimeng, Wen Congyang

[-- Attachment #1: Type: text/plain, Size: 1818 bytes --]

On 02/23/2017 01:14 AM, Zhang Chen wrote:
> We can call this qmp command to do checkpoint outside of qemu.
> Xen colo will need this function.
> 
> Signed-off-by: Zhang Chen <zhangchen.fnst@cn.fujitsu.com>
> Signed-off-by: Wen Congyang <wencongyang@gmail.com>
> Reviewed-by: Eric Blake <eblake@redhat.com>

You made a substantial change to this patch since v7 in response to my
comments; when you do that, it's best to remove the R-b to make sure I
re-review the changes and am still happy with them.

> 
> ---
>  migration/colo.c | 23 +++++++++++++++++++++++
>  qapi-schema.json | 48 ++++++++++++++++++++++++++++++++++++++++++++++++
>  2 files changed, 71 insertions(+)
> 

>  ##
> +# @ReplicationStatus:
> +#
> +# The result format for 'query-xen-replication-status'.
> +#
> +# @status: true to error, false to normal.

This is now a poor name for the parameter.  Please rename it; probably
to @error (if you want to keep true meaning a problem has been
detected), or to @okay (if you want to invert the sense, and @desc is
only present when @okay is false).

> +#
> +# @desc: #optional the human readable error description string, when
> +#        @status is 'true'.
> +#
> +# Since: 2.9
> +##
> +{ 'struct': 'ReplicationStatus',
> +  'data': { 'status': 'bool', '*desc': 'str' } }
> +
> +##
> +# @query-xen-replication-status:
> +#
> +# Query replication status while the vm is running.
> +#
> +# Returns: A @ReplicationResult objects showing the status.

s/objects/object/

> +#
> +# Example:
> +#
> +# -> { "execute": "query-xen-replication-status" }
> +# <- { "return": { "status": "normal" } }

This example is now wrong.

You'll need a v9.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [Qemu-devel] [PATCH V8 1/2] Add a new qmp command to start/stop replication
  2017-02-23 15:31   ` Eric Blake
@ 2017-02-24  3:56     ` Zhang Chen
  0 siblings, 0 replies; 9+ messages in thread
From: Zhang Chen @ 2017-02-24  3:56 UTC (permalink / raw)
  To: Eric Blake, qemu devel, zhanghailiang, Markus Armbruster,
	Stefano Stabellini
  Cc: zhangchen.fnst, Jason Wang, Li Zhijian, eddie . dong,
	bian naimeng, Wen Congyang



On 02/23/2017 11:31 PM, Eric Blake wrote:
> On 02/23/2017 01:14 AM, Zhang Chen wrote:
>> We can call this qmp command to start/stop replication outside of qemu.
>> Like Xen colo need this function.
>>
>> Signed-off-by: Zhang Chen <zhangchen.fnst@cn.fujitsu.com>
>> Signed-off-by: Wen Congyang <wencongyang@gmail.com>
>> Reviewed-by: Eric Blake <eblake@redhat.com>
>> Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
>> Reviewed-by: zhanghailiang <zhang.zhanghailiang@huawei.com>
>>
>> ---
>> @@ -104,6 +106,27 @@ void colo_do_failover(MigrationState *s)
>>       }
>>   }
>>   
>> +void qmp_xen_set_replication(bool enable, bool primary,
>> +                             bool has_failover, bool failover,
>> +                             Error **errp)
>> +{
>> +    ReplicationMode mode = primary ?
>> +                           REPLICATION_MODE_PRIMARY :
>> +                           REPLICATION_MODE_SECONDARY;
>> +
>> +    if (has_failover && enable) {
>> +        error_setg(errp, "Parameter 'failover' is only for"
>> +                   " stopping replication");
>> +        return;
>> +    }
>> +
>> +    if (enable) {
>> +        replication_start_all(mode, errp);
>> +    } else {
>> +        replication_stop_all(failover, failover ? NULL : errp);
> Technically, this is use of failover without first checking
> has_failover; it would be safer if you inserted:
>
> if (!has_failover) {
>      failover = NULL;
> }

OK, I will insert this code in next version.

Thanks
Zhang Chen

> earlier in the function to be safe against any callers that don't go
> through the QAPI-generated code.  Fortunately, our QAPI generated code
> guarantees that failover is NULL when has_failover is false, so my R-b
> can stand as-is if there is no other reason for a respin.

-- 
Thanks
Zhang Chen

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [Qemu-devel] [PATCH V8 2/2] Add a new qmp command to do checkpoint, query xen replication status
  2017-02-23 15:34   ` Eric Blake
@ 2017-02-24  5:33     ` Zhang Chen
  2017-03-03 13:45     ` Markus Armbruster
  1 sibling, 0 replies; 9+ messages in thread
From: Zhang Chen @ 2017-02-24  5:33 UTC (permalink / raw)
  To: Eric Blake, qemu devel, zhanghailiang, Markus Armbruster,
	Stefano Stabellini
  Cc: zhangchen.fnst, Jason Wang, Li Zhijian, eddie . dong,
	bian naimeng, Wen Congyang



On 02/23/2017 11:34 PM, Eric Blake wrote:
> On 02/23/2017 01:14 AM, Zhang Chen wrote:
>> We can call this qmp command to do checkpoint outside of qemu.
>> Xen colo will need this function.
>>
>> Signed-off-by: Zhang Chen <zhangchen.fnst@cn.fujitsu.com>
>> Signed-off-by: Wen Congyang <wencongyang@gmail.com>
>> Reviewed-by: Eric Blake <eblake@redhat.com>
> You made a substantial change to this patch since v7 in response to my
> comments; when you do that, it's best to remove the R-b to make sure I
> re-review the changes and am still happy with them.

OK, I will remove the R-b in next version.

>
>> ---
>>   migration/colo.c | 23 +++++++++++++++++++++++
>>   qapi-schema.json | 48 ++++++++++++++++++++++++++++++++++++++++++++++++
>>   2 files changed, 71 insertions(+)
>>
>>   ##
>> +# @ReplicationStatus:
>> +#
>> +# The result format for 'query-xen-replication-status'.
>> +#
>> +# @status: true to error, false to normal.
> This is now a poor name for the parameter.  Please rename it; probably
> to @error (if you want to keep true meaning a problem has been
> detected), or to @okay (if you want to invert the sense, and @desc is
> only present when @okay is false).

I will rename it to "@error" in next version.

>
>> +#
>> +# @desc: #optional the human readable error description string, when
>> +#        @status is 'true'.
>> +#
>> +# Since: 2.9
>> +##
>> +{ 'struct': 'ReplicationStatus',
>> +  'data': { 'status': 'bool', '*desc': 'str' } }
>> +
>> +##
>> +# @query-xen-replication-status:
>> +#
>> +# Query replication status while the vm is running.
>> +#
>> +# Returns: A @ReplicationResult objects showing the status.
> s/objects/object/

I got it.

>
>> +#
>> +# Example:
>> +#
>> +# -> { "execute": "query-xen-replication-status" }
>> +# <- { "return": { "status": "normal" } }
> This example is now wrong.
>
> You'll need a v9.

Yes, I will send the V9 later.

Thanks
Zhang Chen

>

-- 
Thanks
Zhang Chen

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [Qemu-devel] [PATCH V8 2/2] Add a new qmp command to do checkpoint, query xen replication status
  2017-02-23 15:34   ` Eric Blake
  2017-02-24  5:33     ` Zhang Chen
@ 2017-03-03 13:45     ` Markus Armbruster
  2017-03-03 16:01       ` Eric Blake
  1 sibling, 1 reply; 9+ messages in thread
From: Markus Armbruster @ 2017-03-03 13:45 UTC (permalink / raw)
  To: Eric Blake
  Cc: Zhang Chen, qemu devel, zhanghailiang, Stefano Stabellini,
	Wen Congyang, Jason Wang, eddie . dong, bian naimeng, Li Zhijian

Eric Blake <eblake@redhat.com> writes:

> On 02/23/2017 01:14 AM, Zhang Chen wrote:
>> We can call this qmp command to do checkpoint outside of qemu.
>> Xen colo will need this function.
>> 
>> Signed-off-by: Zhang Chen <zhangchen.fnst@cn.fujitsu.com>
>> Signed-off-by: Wen Congyang <wencongyang@gmail.com>
>> Reviewed-by: Eric Blake <eblake@redhat.com>
>
> You made a substantial change to this patch since v7 in response to my
> comments; when you do that, it's best to remove the R-b to make sure I
> re-review the changes and am still happy with them.
>
>> 
>> ---
>>  migration/colo.c | 23 +++++++++++++++++++++++
>>  qapi-schema.json | 48 ++++++++++++++++++++++++++++++++++++++++++++++++
>>  2 files changed, 71 insertions(+)
>> 
>
>>  ##
>> +# @ReplicationStatus:
>> +#
>> +# The result format for 'query-xen-replication-status'.
>> +#
>> +# @status: true to error, false to normal.
>
> This is now a poor name for the parameter.  Please rename it; probably
> to @error (if you want to keep true meaning a problem has been
> detected), or to @okay (if you want to invert the sense, and @desc is
> only present when @okay is false).

We could replace both members by '*error': 'str', present exactly when
status is "bad".

>> +#
>> +# @desc: #optional the human readable error description string, when
>> +#        @status is 'true'.
>> +#
>> +# Since: 2.9
>> +##
>> +{ 'struct': 'ReplicationStatus',
>> +  'data': { 'status': 'bool', '*desc': 'str' } }
>> +
>> +##
>> +# @query-xen-replication-status:
>> +#
>> +# Query replication status while the vm is running.
>> +#
>> +# Returns: A @ReplicationResult objects showing the status.
>
> s/objects/object/
>
>> +#
>> +# Example:
>> +#
>> +# -> { "execute": "query-xen-replication-status" }
>> +# <- { "return": { "status": "normal" } }
>
> This example is now wrong.
>
> You'll need a v9.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [Qemu-devel] [PATCH V8 2/2] Add a new qmp command to do checkpoint, query xen replication status
  2017-03-03 13:45     ` Markus Armbruster
@ 2017-03-03 16:01       ` Eric Blake
  0 siblings, 0 replies; 9+ messages in thread
From: Eric Blake @ 2017-03-03 16:01 UTC (permalink / raw)
  To: Markus Armbruster
  Cc: Zhang Chen, qemu devel, zhanghailiang, Stefano Stabellini,
	Wen Congyang, Jason Wang, eddie . dong, bian naimeng, Li Zhijian

[-- Attachment #1: Type: text/plain, Size: 2255 bytes --]

On 03/03/2017 07:45 AM, Markus Armbruster wrote:
> Eric Blake <eblake@redhat.com> writes:
> 
>> On 02/23/2017 01:14 AM, Zhang Chen wrote:
>>> We can call this qmp command to do checkpoint outside of qemu.
>>> Xen colo will need this function.
>>>
>>> Signed-off-by: Zhang Chen <zhangchen.fnst@cn.fujitsu.com>
>>> Signed-off-by: Wen Congyang <wencongyang@gmail.com>
>>> Reviewed-by: Eric Blake <eblake@redhat.com>
>>
>> You made a substantial change to this patch since v7 in response to my
>> comments; when you do that, it's best to remove the R-b to make sure I
>> re-review the changes and am still happy with them.
>>

>>> +# @ReplicationStatus:
>>> +#
>>> +# The result format for 'query-xen-replication-status'.
>>> +#
>>> +# @status: true to error, false to normal.
>>
>> This is now a poor name for the parameter.  Please rename it; probably
>> to @error (if you want to keep true meaning a problem has been
>> detected), or to @okay (if you want to invert the sense, and @desc is
>> only present when @okay is false).
> 
> We could replace both members by '*error': 'str', present exactly when
> status is "bad".
> 
>>> +#
>>> +# @desc: #optional the human readable error description string, when
>>> +#        @status is 'true'.
>>> +#
>>> +# Since: 2.9
>>> +##
>>> +{ 'struct': 'ReplicationStatus',
>>> +  'data': { 'status': 'bool', '*desc': 'str' } }

Except that ReplicationStatus would then be the empty struct on success.
 I guess that's okay, but seems a bit odd.


>>> +# Example:
>>> +#
>>> +# -> { "execute": "query-xen-replication-status" }
>>> +# <- { "return": { "status": "normal" } }
>>
>> This example is now wrong.
>>
>> You'll need a v9.

which has already been submitted and turned into a pull request:
https://lists.gnu.org/archive/html/qemu-devel/2017-02/msg07652.html

It pre-dated your mandate of "all new QMP commands must have a test":
https://lists.gnu.org/archive/html/qemu-devel/2017-03/msg00296.html

but the idea is still relevant, so a followup patch for 2.9 that adds
testsuite coverage of the new commands is appropriate during soft freeze.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2017-03-03 16:01 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-23  7:14 [Qemu-devel] [PATCH V8 0/2] Add new qmp commands to suppurt Xen COLO Zhang Chen
2017-02-23  7:14 ` [Qemu-devel] [PATCH V8 1/2] Add a new qmp command to start/stop replication Zhang Chen
2017-02-23 15:31   ` Eric Blake
2017-02-24  3:56     ` Zhang Chen
2017-02-23  7:14 ` [Qemu-devel] [PATCH V8 2/2] Add a new qmp command to do checkpoint, query xen replication status Zhang Chen
2017-02-23 15:34   ` Eric Blake
2017-02-24  5:33     ` Zhang Chen
2017-03-03 13:45     ` Markus Armbruster
2017-03-03 16:01       ` Eric Blake

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.