From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50084) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZVRth-0007NZ-Sc for qemu-devel@nongnu.org; Fri, 28 Aug 2015 18:13:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZVRte-000697-H8 for qemu-devel@nongnu.org; Fri, 28 Aug 2015 18:13:21 -0400 Received: from mx1.redhat.com ([209.132.183.28]:48661) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZVRte-00068R-9W for qemu-devel@nongnu.org; Fri, 28 Aug 2015 18:13:18 -0400 References: <1438159544-6224-1-git-send-email-zhang.zhanghailiang@huawei.com> <1438159544-6224-20-git-send-email-zhang.zhanghailiang@huawei.com> From: Eric Blake Message-ID: <55E0DCFB.2070402@redhat.com> Date: Fri, 28 Aug 2015 16:13:15 -0600 MIME-Version: 1.0 In-Reply-To: <1438159544-6224-20-git-send-email-zhang.zhanghailiang@huawei.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="ivMkOjTu1nV2TLprAUHIvtkAg1Lt6piUt" Subject: Re: [Qemu-devel] [PATCH COLO-Frame v8 19/34] qmp event: Add event notification for COLO error List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: zhanghailiang , qemu-devel@nongnu.org Cc: 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, Michael Roth This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --ivMkOjTu1nV2TLprAUHIvtkAg1Lt6piUt Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 07/29/2015 02:45 AM, zhanghailiang wrote: > If some errors happen during VM's COLO FT stage, it's import to notify = the users s/import/important/ > this event, Togehter with 'colo_lost_heartbeat', users can intervene in= COLO's s/this event,/of this event./ s/Togehter/Together/ > failover work immediately. > If users don't want to get involved in COLO's failover verdict, > it is still necessary to notify users that we exit COLO mode. >=20 > Cc: Markus Armbruster > Cc: Michael Roth > Signed-off-by: zhanghailiang > Signed-off-by: Li Zhijian > --- > docs/qmp/qmp-events.txt | 16 ++++++++++++++++ > migration/colo.c | 11 ++++++++++- > qapi/event.json | 15 +++++++++++++++ > 3 files changed, 41 insertions(+), 1 deletion(-) >=20 Interface review: > +++ b/docs/qmp/qmp-events.txt > @@ -488,6 +488,22 @@ Example: > {"timestamp": {"seconds": 1432121972, "microseconds": 744001}, > "event": "MIGRATION", "data": {"status": "completed"}} > =20 > +COLO_EXIT > +--------- This file is alphabetical prior to your patch; please insert your event prior to DEVICE_DELETED. > + > +Emitted when VM finish COLO mode due to some errors happening or s/finish/finishes/ > +the request of users. > + > +Data: None. > + > + - "mode": COLO mode, 'primary' or 'secondary' > + - "error": Error message (json-string, optional) > + > +Example: > + > +{"timestamp": {"seconds": 2032141960, "microseconds": 417172}, > + "event": "COLO_EXIT", "data": {"mode": "primary"}} It might also be useful to provide a machine-parseable parameter on whether the exit was due to an internal error vs. an external request. Maybe by adding 'flag':'bool', since presence or absence of 'error' is not as nice. > +++ b/migration/colo.c > @@ -581,7 +590,7 @@ out: > error_report("Secondary VM will take over work"); > break; > } > - usleep(200*1000); > + usleep(200 * 1000); > } Unrelated whitespace tweak. Please squash this hunk into the patch that introduced the problem. > +++ b/qapi/event.json > @@ -255,6 +255,21 @@ > 'data': {'status': 'MigrationStatus'}} > =20 > ## > +# @COLO_EXIT > +# > +# Emitted when VM finish COLO mode due to some errors happening or s/finish/finishes/ > +# the request of users. > +# > +# @mode: 'primary' or 'secondeary'. s/secondeary/secondary/ > +# > +# @error: #optional, error message. Only present on error happening. > +# > +# Since: 2.4 2.5 > +## > +{ 'event': 'COLO_EXIT', > + 'data': {'mode': 'str', '*error':'str'}} Please use 'mode':'COLOMode' (we already have an enum; for a finite set of strings, it's nicer to use the enum than the open-coded 'str'). --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --ivMkOjTu1nV2TLprAUHIvtkAg1Lt6piUt 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/ iQEcBAEBCAAGBQJV4Nz7AAoJEKeha0olJ0Nq9ZUH/0VsUBjBXYQ3inCWW7IUket1 j844kvMHoMDctTfpFWKlEvRZXDgpP15olFiBMGvVFo8Bll1+6P/8tBhXN68bBfr/ 1gsWAIFyN53QRGsPIFXK+Zlber2oLRzvUh4vOONoRbZWgYdhL76aaLr+Dcm8LsGM jUD+TR2R77kU3bkQLod0btd4Ma3uCIW4wqzoIwuumH9Pv9Q4mEYK8/MAut0/5we5 HGExxNx/K8FrJ9q0O8IG0tIiV+62rTrQ3/DESiLCm0+Yd/zA1Ehsdq8UZ+b3ZP29 Kql5bgx82FC8G/0sT8+6NDUCzE7LPe0LNKEurBMCClDhcdPOCfUL83LjmCDgVMw= =20/S -----END PGP SIGNATURE----- --ivMkOjTu1nV2TLprAUHIvtkAg1Lt6piUt--