diff mbox

[3/3] Add a new qmp command to do checkpoint, get replication error

Message ID 1480572399-10455-4-git-send-email-zhangchen.fnst@cn.fujitsu.com (mailing list archive)
State New, archived
Headers show

Commit Message

Zhang Chen Dec. 1, 2016, 6:06 a.m. UTC
We can call this qmp command to do checkpoint outside of qemu.
Like Xen colo need this function.

Signed-off-by: Zhang Chen <zhangchen.fnst@cn.fujitsu.com>
Signed-off-by: Wen Congyang <wency@cn.fujitsu.com>
---
 docs/qmp-commands.txt | 24 ++++++++++++++++++++++++
 migration/colo.c      | 10 ++++++++++
 qapi-schema.json      | 22 ++++++++++++++++++++++
 3 files changed, 56 insertions(+)

Comments

Eric Blake Dec. 1, 2016, 2:55 p.m. UTC | #1
On 12/01/2016 12:06 AM, Zhang Chen wrote:
> We can call this qmp command to do checkpoint outside of qemu.
> Like Xen colo need this function.
> 
> Signed-off-by: Zhang Chen <zhangchen.fnst@cn.fujitsu.com>
> Signed-off-by: Wen Congyang <wency@cn.fujitsu.com>
> ---
>  docs/qmp-commands.txt | 24 ++++++++++++++++++++++++

> +++ b/qapi-schema.json
> @@ -4694,6 +4694,28 @@
>    'data': { 'enable': 'bool', 'primary': 'bool', '*failover' : 'bool' } }
>  
>  ##
> +# @xen-get-replication-error
> +#
> +# Get replicatin error that occurs when the vm is running

s/replicatin/replication/

> +#
> +# Returns: nothing
> +#
> +# Since: 2.8

You've missed 2.8.

> +##
> +{ 'command': 'xen-get-replication-error' }
> +
> +##
> +# @xen-do-checkpoint
> +#
> +# Do checkpoint
> +#
> +# Returns: nothing
> +#
> +# Since: 2.8

Again, should be 2.9

> +##
> +{ 'command': 'xen-do-checkpoint' }
> +
> +##
>  # @GICCapability:
>  #
>  # The struct describes capability for a specific GIC (Generic
>
Zhang Chen Dec. 2, 2016, 4 a.m. UTC | #2
On 12/01/2016 10:55 PM, Eric Blake wrote:
> On 12/01/2016 12:06 AM, Zhang Chen wrote:
>> We can call this qmp command to do checkpoint outside of qemu.
>> Like Xen colo need this function.
>>
>> Signed-off-by: Zhang Chen <zhangchen.fnst@cn.fujitsu.com>
>> Signed-off-by: Wen Congyang <wency@cn.fujitsu.com>
>> ---
>>   docs/qmp-commands.txt | 24 ++++++++++++++++++++++++
>> +++ b/qapi-schema.json
>> @@ -4694,6 +4694,28 @@
>>     'data': { 'enable': 'bool', 'primary': 'bool', '*failover' : 'bool' } }
>>   
>>   ##
>> +# @xen-get-replication-error
>> +#
>> +# Get replicatin error that occurs when the vm is running
> s/replicatin/replication/

OK.

>
>> +#
>> +# Returns: nothing
>> +#
>> +# Since: 2.8
> You've missed 2.8.

I will fix this in next version.


>> +##
>> +{ 'command': 'xen-get-replication-error' }
>> +
>> +##
>> +# @xen-do-checkpoint
>> +#
>> +# Do checkpoint
>> +#
>> +# Returns: nothing
>> +#
>> +# Since: 2.8
> Again, should be 2.9

I will fix this in next version.

Thanks
Zhang Chen

>> +##
>> +{ 'command': 'xen-do-checkpoint' }
>> +
>> +##
>>   # @GICCapability:
>>   #
>>   # The struct describes capability for a specific GIC (Generic
>>
diff mbox

Patch

diff --git a/docs/qmp-commands.txt b/docs/qmp-commands.txt
index c6e8c43..1c7a887 100644
--- a/docs/qmp-commands.txt
+++ b/docs/qmp-commands.txt
@@ -449,6 +449,30 @@  Example:
      "arguments": {"enable": true, "primary": false} }
 <- { "return": {} }
 
+xen-get-replication-error
+-------
+
+Get replication error that occurs when vm is running
+
+Arguments: None
+
+Example:
+
+-> { "execute": "xen-get-replication-error" }
+<- { "return": {} }
+
+xen-do-checkpoint
+-------
+
+Do checkpoint
+
+Arguments: None
+
+Example:
+
+-> { "execute": "xen-do-checkpoint" }
+<- { "return": {} }
+
 migrate
 -------
 
diff --git a/migration/colo.c b/migration/colo.c
index 007e699..92b2ef4 100644
--- a/migration/colo.c
+++ b/migration/colo.c
@@ -126,6 +126,16 @@  void qmp_xen_set_replication(bool enable, bool primary,
     }
 }
 
+void qmp_xen_get_replication_error(Error **errp)
+    {
+        replication_get_error_all(errp);
+    }
+
+void qmp_xen_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 3658764..0a90c39 100644
--- a/qapi-schema.json
+++ b/qapi-schema.json
@@ -4694,6 +4694,28 @@ 
   'data': { 'enable': 'bool', 'primary': 'bool', '*failover' : 'bool' } }
 
 ##
+# @xen-get-replication-error
+#
+# Get replicatin error that occurs when the vm is running
+#
+# Returns: nothing
+#
+# Since: 2.8
+##
+{ 'command': 'xen-get-replication-error' }
+
+##
+# @xen-do-checkpoint
+#
+# Do checkpoint
+#
+# Returns: nothing
+#
+# Since: 2.8
+##
+{ 'command': 'xen-do-checkpoint' }
+
+##
 # @GICCapability:
 #
 # The struct describes capability for a specific GIC (Generic