From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48516) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZVRnB-0004wf-Pl for qemu-devel@nongnu.org; Fri, 28 Aug 2015 18:06:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZVRn8-0002Uo-J9 for qemu-devel@nongnu.org; Fri, 28 Aug 2015 18:06:37 -0400 Received: from mx1.redhat.com ([209.132.183.28]:58356) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZVRn8-0002UP-BE for qemu-devel@nongnu.org; Fri, 28 Aug 2015 18:06:34 -0400 References: <1438159544-6224-1-git-send-email-zhang.zhanghailiang@huawei.com> <1438159544-6224-17-git-send-email-zhang.zhanghailiang@huawei.com> From: Eric Blake Message-ID: <55E0DB66.6090203@redhat.com> Date: Fri, 28 Aug 2015 16:06:30 -0600 MIME-Version: 1.0 In-Reply-To: <1438159544-6224-17-git-send-email-zhang.zhanghailiang@huawei.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="IxopaACmt5cNxxrJlddHWNOatGrherdKP" 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: zhanghailiang , 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 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --IxopaACmt5cNxxrJlddHWNOatGrherdKP Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 07/29/2015 02:45 AM, 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. >=20 > 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. 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. >=20 > 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" > =20 > /* Fix me: Convert to use QAPI */ Just noticing this comment; I'm assuming v9 will do more with qapi? > +++ b/qapi-schema.json > @@ -666,6 +666,31 @@ > '*tls-port': 'int', '*cert-subject': 'str' } } > =20 > ## > +# @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. > + > +## > +# @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 > =20 > { > + .name =3D "colo-lost-heartbeat", > + .args_type =3D "", > + .mhandler.cmd_new =3D 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. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --IxopaACmt5cNxxrJlddHWNOatGrherdKP Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJV4NtmAAoJEKeha0olJ0NqKGoIAJvRVVFA8cHi3UaGj+OFWp2R pX/3RP44sFzvN3ECAAOXGyqxiuLOo7ukDBBewev7IB7+omZ7XOXIEqJCF8Qfvcgm 2nJ/kL31YKBFgTubCLnh+PFqrrzOWKC5BuOIdAfkanoyf0bVDVsDaVRnS5vfILCd dHE80BQ2yHP2QIutgyuuVPJu+H65Jid2ylaKeRrEov8vVOwKAIW+VCOrhgzeCz6I I2LrS9zVnpYYWQkBsaYQTG/PZrpUSUOkQjSNrt1iU9Zi8LoHGewn8QiKRCqX//kf qFSXGdjTw+86qtqeybTy5LJp9zEpAYfJCjztabwdbNG+mezbtWrrUp0fqOnlTTc= =uZzp -----END PGP SIGNATURE----- --IxopaACmt5cNxxrJlddHWNOatGrherdKP--