From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54964) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YQWEQ-0007Ac-3f for qemu-devel@nongnu.org; Wed, 25 Feb 2015 02:18:10 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YQWEL-00015t-SR for qemu-devel@nongnu.org; Wed, 25 Feb 2015 02:18:06 -0500 Received: from [59.151.112.132] (port=51793 helo=heian.cn.fujitsu.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YQWEL-00011n-Es for qemu-devel@nongnu.org; Wed, 25 Feb 2015 02:18:01 -0500 Message-ID: <54ED76B1.2040805@cn.fujitsu.com> Date: Wed, 25 Feb 2015 15:16:01 +0800 From: Hongyang Yang MIME-Version: 1.0 References: <1423711034-5340-1-git-send-email-zhang.zhanghailiang@huawei.com> <1423711034-5340-15-git-send-email-zhang.zhanghailiang@huawei.com> <54E2818C.4000800@redhat.com> <54ED7412.9000302@huawei.com> In-Reply-To: <54ED7412.9000302@huawei.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH RFC v3 14/27] COLO failover: Introduce a new command to trigger a failover List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: zhanghailiang , Eric Blake , qemu-devel@nongnu.org Cc: hangaohuai@huawei.com, Lai Jiangshan , Li Zhijian , yunhong.jiang@intel.com, eddie.dong@intel.com, peter.huangpeng@huawei.com, dgilbert@redhat.com, stefanha@redhat.com, pbonzini@redhat.com =E5=9C=A8 02/25/2015 03:04 PM, zhanghailiang =E5=86=99=E9=81=93: > On 2015/2/17 7:47, Eric Blake wrote: >> On 02/11/2015 08:17 PM, zhanghailiang wrote: >>> We leave users to use whatever heartbeat solution they want, if the hea= rtbeat >>> is lost, or other errors they detect, they can use command >>> 'colo_lost_heartbeat' to tell COLO to do failover, COLO will do operati= ons >>> 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 s= erver. >>> >>> Signed-off-by: zhanghailiang >>> Signed-off-by: Li Zhijian >>> Signed-off-by: Lai Jiangshan >>> Signed-off-by: Yang Hongyang >>> --- >>> hmp-commands.hx | 15 ++++++++++++++ >>> hmp.c | 7 +++++++ >>> hmp.h | 1 + >>> include/migration/migration-colo.h | 1 + >>> include/migration/migration-failover.h | 20 ++++++++++++++++++ >>> migration/Makefile.objs | 2 +- >>> migration/colo-failover.c | 38 +++++++++++++++++++++++++= +++++++++ >>> migration/colo.c | 1 + >>> qapi-schema.json | 9 ++++++++ >>> qmp-commands.hx | 19 +++++++++++++++++ >>> stubs/migration-colo.c | 8 +++++++ >>> 11 files changed, 120 insertions(+), 1 deletion(-) >>> create mode 100644 include/migration/migration-failover.h >>> create mode 100644 migration/colo-failover.c >>> >>> diff --git a/hmp-commands.hx b/hmp-commands.hx >> >>> +++ b/qapi-schema.json >>> @@ -543,6 +543,15 @@ >>> { 'command': 'query-migrate-capabilities', 'returns': >>> ['MigrationCapabilityStatus']} >>> >>> ## >>> +# @colo-lost-heartbeat >>> +# >>> +# Tell COLO that heartbeat is lost >>> +# >>> +# Since: 2.3 >>> +## >>> +{ 'command': 'colo-lost-heartbeat' } >> >> Okay... >> >>> + >>> +## >>> # @MouseInfo: >>> # >>> # Information about a mouse device. >>> diff --git a/qmp-commands.hx b/qmp-commands.hx >>> index a85d847..1b4a5ca 100644 >>> --- a/qmp-commands.hx >>> +++ b/qmp-commands.hx >>> @@ -753,6 +753,25 @@ Example: >>> EQMP >>> >>> { >>> + .name =3D "colo_lost_heartbeat", >> >> ...but documented incorrectly (this should use '-' to match the command >> name in the .json file, not '_') >> > > Er, yes, you are right, here it should be 'colo-lost-heartbeat' in qmp-co= mmands.hx, > but 'colo_lost_heartbeat' in hmp-commands.hx, it is a little confused for= me, > why it should be like this? > > i will fix it. > >>> + .args_type =3D "", >>> + .mhandler.cmd_new =3D qmp_marshal_input_colo_lost_heartbeat, >>> + }, >>> + >>> +SQMP >>> +colo_lost_heartbeat >>> +-------------------- >>> + >>> +Tell COLO that heartbeat is lost, a failover or takeover is needed. >>> + >>> +Example: >>> + >>> +-> { "execute": "colo_lost_heartbeat" } >>> +<- { "return": {} } >> >> This example won't work unless you fix the spelling. >> > > Should here also be changed to 'colo-lost-heartbeat' ? No... > > Thanks, > zhanghailiang > > > . > --=20 Thanks, Yang.