* [Qemu-devel] [PULL 0/2] tags/xen-20170228-tag @ 2017-02-28 19:15 Stefano Stabellini 2017-02-28 19:16 ` [Qemu-devel] [PULL 1/2] Add a new qmp command to start/stop replication Stefano Stabellini 2017-03-01 23:09 ` [Qemu-devel] [PULL 0/2] tags/xen-20170228-tag Peter Maydell 0 siblings, 2 replies; 4+ messages in thread From: Stefano Stabellini @ 2017-02-28 19:15 UTC (permalink / raw) To: peter.maydell, stefanha Cc: sstabellini, stefanha, anthony.perard, xen-devel, qemu-devel The following changes since commit 7d1730b7d9d8272a13245adfc9b0405e5a4bd0c2: Merge remote-tracking branch 'remotes/mjt/tags/trivial-patches-fetch' into staging (2017-02-28 16:22:41 +0000) are available in the git repository at: git://xenbits.xen.org/people/sstabellini/qemu-dm.git tags/xen-20170228-tag for you to fetch changes up to daa33c52153df48ef0a7d06013f8ca6f24eff92f: Add a new qmp command to do checkpoint, query xen replication status (2017-02-28 11:02:12 -0800) ---------------------------------------------------------------- Xen 2017/02/28 ---------------------------------------------------------------- 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 | 49 +++++++++++++++++++++++++++++++++++++ qapi-schema.json | 73 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 122 insertions(+) ^ permalink raw reply [flat|nested] 4+ messages in thread
* [Qemu-devel] [PULL 1/2] Add a new qmp command to start/stop replication 2017-02-28 19:15 [Qemu-devel] [PULL 0/2] tags/xen-20170228-tag Stefano Stabellini @ 2017-02-28 19:16 ` Stefano Stabellini 2017-02-28 19:16 ` [Qemu-devel] [PULL 2/2] Add a new qmp command to do checkpoint, query xen replication status Stefano Stabellini 2017-03-01 23:09 ` [Qemu-devel] [PULL 0/2] tags/xen-20170228-tag Peter Maydell 1 sibling, 1 reply; 4+ messages in thread From: Stefano Stabellini @ 2017-02-28 19:16 UTC (permalink / raw) To: peter.maydell, stefanha Cc: sstabellini, stefanha, anthony.perard, xen-devel, qemu-devel, Zhang Chen, Wen Congyang From: Zhang Chen <zhangchen.fnst@cn.fujitsu.com> 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> Signed-off-by: Stefano Stabellini <sstabellini@kernel.org> --- migration/colo.c | 26 ++++++++++++++++++++++++++ qapi-schema.json | 25 +++++++++++++++++++++++++ 2 files changed, 51 insertions(+) diff --git a/migration/colo.c b/migration/colo.c index 712308e..46bc84d 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" static bool vmstate_loading; @@ -147,6 +149,30 @@ 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 { + if (!has_failover) { + failover = NULL; + } + 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 150ee98..dbc1ebc 100644 --- a/qapi-schema.json +++ b/qapi-schema.json @@ -5990,6 +5990,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 -- 1.9.1 ^ permalink raw reply related [flat|nested] 4+ messages in thread
* [Qemu-devel] [PULL 2/2] Add a new qmp command to do checkpoint, query xen replication status 2017-02-28 19:16 ` [Qemu-devel] [PULL 1/2] Add a new qmp command to start/stop replication Stefano Stabellini @ 2017-02-28 19:16 ` Stefano Stabellini 0 siblings, 0 replies; 4+ messages in thread From: Stefano Stabellini @ 2017-02-28 19:16 UTC (permalink / raw) To: peter.maydell, stefanha Cc: sstabellini, stefanha, anthony.perard, xen-devel, qemu-devel, Zhang Chen, Wen Congyang From: Zhang Chen <zhangchen.fnst@cn.fujitsu.com> 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> Signed-off-by: Stefano Stabellini <sstabellini@kernel.org> --- migration/colo.c | 23 +++++++++++++++++++++++ qapi-schema.json | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 71 insertions(+) diff --git a/migration/colo.c b/migration/colo.c index 46bc84d..c19eb3f 100644 --- a/migration/colo.c +++ b/migration/colo.c @@ -173,6 +173,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->error = true; + s->has_desc = true; + s->desc = g_strdup(error_get_pretty(err)); + } else { + s->error = 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 dbc1ebc..d6186d4 100644 --- a/qapi-schema.json +++ b/qapi-schema.json @@ -6015,6 +6015,54 @@ 'data': { 'enable': 'bool', 'primary': 'bool', '*failover' : 'bool' } } ## +# @ReplicationStatus: +# +# The result format for 'query-xen-replication-status'. +# +# @error: true if an error happened, false if replication is normal. +# +# @desc: #optional the human readable error description string, when +# @error is 'true'. +# +# Since: 2.9 +## +{ 'struct': 'ReplicationStatus', + 'data': { 'error': 'bool', '*desc': 'str' } } + +## +# @query-xen-replication-status: +# +# Query replication status while the vm is running. +# +# Returns: A @ReplicationResult object showing the status. +# +# Example: +# +# -> { "execute": "query-xen-replication-status" } +# <- { "return": { "error": false } } +# +# 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 -- 1.9.1 ^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PULL 0/2] tags/xen-20170228-tag 2017-02-28 19:15 [Qemu-devel] [PULL 0/2] tags/xen-20170228-tag Stefano Stabellini 2017-02-28 19:16 ` [Qemu-devel] [PULL 1/2] Add a new qmp command to start/stop replication Stefano Stabellini @ 2017-03-01 23:09 ` Peter Maydell 1 sibling, 0 replies; 4+ messages in thread From: Peter Maydell @ 2017-03-01 23:09 UTC (permalink / raw) To: Stefano Stabellini Cc: Stefan Hajnoczi, Stefan Hajnoczi, Anthony PERARD, xen-devel, QEMU Developers On 28 February 2017 at 19:15, Stefano Stabellini <sstabellini@kernel.org> wrote: > The following changes since commit 7d1730b7d9d8272a13245adfc9b0405e5a4bd0c2: > > Merge remote-tracking branch 'remotes/mjt/tags/trivial-patches-fetch' into staging (2017-02-28 16:22:41 +0000) > > are available in the git repository at: > > > git://xenbits.xen.org/people/sstabellini/qemu-dm.git tags/xen-20170228-tag > > for you to fetch changes up to daa33c52153df48ef0a7d06013f8ca6f24eff92f: > > Add a new qmp command to do checkpoint, query xen replication status (2017-02-28 11:02:12 -0800) > > ---------------------------------------------------------------- > Xen 2017/02/28 > > ---------------------------------------------------------------- > Zhang Chen (2): > Add a new qmp command to start/stop replication > Add a new qmp command to do checkpoint, query xen replication status > Applied, thanks. -- PMM ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-03-01 23:09 UTC | newest] Thread overview: 4+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2017-02-28 19:15 [Qemu-devel] [PULL 0/2] tags/xen-20170228-tag Stefano Stabellini 2017-02-28 19:16 ` [Qemu-devel] [PULL 1/2] Add a new qmp command to start/stop replication Stefano Stabellini 2017-02-28 19:16 ` [Qemu-devel] [PULL 2/2] Add a new qmp command to do checkpoint, query xen replication status Stefano Stabellini 2017-03-01 23:09 ` [Qemu-devel] [PULL 0/2] tags/xen-20170228-tag Peter Maydell
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).