From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53484) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZWbbu-00059Q-Cf for qemu-devel@nongnu.org; Mon, 31 Aug 2015 22:47:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZWbbr-0001Ya-5L for qemu-devel@nongnu.org; Mon, 31 Aug 2015 22:47:46 -0400 Received: from szxga01-in.huawei.com ([58.251.152.64]:34382) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZWbbq-0001VN-EX for qemu-devel@nongnu.org; Mon, 31 Aug 2015 22:47:43 -0400 References: <1438159544-6224-1-git-send-email-zhang.zhanghailiang@huawei.com> <1438159544-6224-17-git-send-email-zhang.zhanghailiang@huawei.com> <55E0DB66.6090203@redhat.com> From: zhanghailiang Message-ID: <55E511B4.7090105@huawei.com> Date: Tue, 1 Sep 2015 10:47:16 +0800 MIME-Version: 1.0 In-Reply-To: <55E0DB66.6090203@redhat.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH COLO-Frame v8 16/34] COLO failover: Introduce a new command to trigger a failover List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake , qemu-devel@nongnu.org Cc: Yang Hongyang , lizhijian@cn.fujitsu.com, quintela@redhat.com, Markus Armbruster , yunhong.jiang@intel.com, eddie.dong@intel.com, peter.huangpeng@huawei.com, dgilbert@redhat.com, arei.gonglei@huawei.com, amit.shah@redhat.com, Luiz Capitulino On 2015/8/29 6:06, Eric Blake wrote: > On 07/29/2015 02:45 AM, zhanghailiang wrote: >> We leave users to use whatever heartbeat solution they want, if the heartbeat >> is lost, or other errors they detect, they can use command >> 'colo_lost_heartbeat' to tell COLO to do failover, COLO will do operations >> accordingly. >> >> For example, >> If send the command to PVM, Primary will exit COLO mode, and takeover, >> if to Secondary, Secondary will do failover work and at last takeover server. > > Grammar suggestion: > > For example, if the command is sent to the PVM, the Primary side will > exit COLO mode and take over operation. If sent to the Secondary, the > secondary will run failover work, then take over server operation to > become the new Primary. > >> >> Cc: Luiz Capitulino >> Cc: Eric Blake >> Cc: Markus Armbruster >> Signed-off-by: zhanghailiang >> Signed-off-by: Li Zhijian >> Signed-off-by: Yang Hongyang >> --- >> hmp-commands.hx | 15 +++++++++++++++ >> hmp.c | 8 ++++++++ >> hmp.h | 1 + >> include/migration/colo.h | 4 ++++ >> include/migration/failover.h | 20 ++++++++++++++++++++ >> migration/Makefile.objs | 2 +- >> migration/colo-comm.c | 11 +++++++++++ >> migration/colo-failover.c | 41 +++++++++++++++++++++++++++++++++++++++++ >> migration/colo.c | 1 + >> qapi-schema.json | 25 +++++++++++++++++++++++++ >> qmp-commands.hx | 19 +++++++++++++++++++ >> stubs/migration-colo.c | 8 ++++++++ >> 12 files changed, 154 insertions(+), 1 deletion(-) >> create mode 100644 include/migration/failover.h >> create mode 100644 migration/colo-failover.c > > Just an interface review. > >> +++ b/migration/colo.c >> @@ -15,6 +15,7 @@ >> #include "trace.h" >> #include "qemu/error-report.h" >> #include "qemu/sockets.h" >> +#include "migration/failover.h" >> >> /* Fix me: Convert to use QAPI */ > > Just noticing this comment; I'm assuming v9 will do more with qapi? > Yes, i will convert them to QAPI in v9. >> +++ b/qapi-schema.json >> @@ -666,6 +666,31 @@ >> '*tls-port': 'int', '*cert-subject': 'str' } } >> >> ## >> +# @COLOMode >> +# >> +# The colo mode >> +# >> +# @unknown: unknown mode >> +# >> +# @primary: master side >> +# >> +# @secondary: slave side >> +# >> +# Since: 2.4 > > 2.5 > >> +## >> +{ 'enum': 'COLOMode', >> + 'data': [ 'unknown', 'primary', 'secondary'] } > > Where is this enum exposed to the user? Might be worth mentioning in the > commit message if a later patch will use it, and/or reshuffle the series > to have the enum introduced and exposed in one patch (perhaps always > with 'unknown' value), then actually manipulated in later patches. > It will be exposed to users in the later colo exit event, but here we also use it internally in this patch. >> + >> +## >> +# @colo-lost-heartbeat >> +# >> +# Tell qemu that heartbeat is lost, request it to do takeover working. > > s/working/procedures/ > >> +# >> +# Since: 2.4 > > 2.5 > >> +## >> +{ 'command': 'colo-lost-heartbeat' } >> + >> +## >> # @MouseInfo: >> # >> # Information about a mouse device. >> diff --git a/qmp-commands.hx b/qmp-commands.hx >> index bb49a1a..28a7962 100644 >> --- a/qmp-commands.hx >> +++ b/qmp-commands.hx >> @@ -781,6 +781,25 @@ Example: >> EQMP >> >> { >> + .name = "colo-lost-heartbeat", >> + .args_type = "", >> + .mhandler.cmd_new = qmp_marshal_input_colo_lost_heartbeat, > > Markus' work on introspection will s/_input//; depending on what patches > go in first, there will be an obvious merge needed. > I will address all the comments in next version, thanks. :)