From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45563) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a9xVD-0002qZ-KT for qemu-devel@nongnu.org; Fri, 18 Dec 2015 11:03:32 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a9xVA-0001Hm-E2 for qemu-devel@nongnu.org; Fri, 18 Dec 2015 11:03:31 -0500 Received: from mx1.redhat.com ([209.132.183.28]:39735) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a9xVA-0001HY-6h for qemu-devel@nongnu.org; Fri, 18 Dec 2015 11:03:28 -0500 References: <1450167779-9960-1-git-send-email-zhang.zhanghailiang@huawei.com> <1450167779-9960-26-git-send-email-zhang.zhanghailiang@huawei.com> From: Eric Blake Message-ID: <56742E4A.2070609@redhat.com> Date: Fri, 18 Dec 2015 09:03:22 -0700 MIME-Version: 1.0 In-Reply-To: <1450167779-9960-26-git-send-email-zhang.zhanghailiang@huawei.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="hrBSBtIsSu5tQQnaSkm3GEhxs9vhOfuKU" Subject: Re: [Qemu-devel] [PATCH COLO-Frame v12 25/38] 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, stefanha@redhat.com, amit.shah@redhat.com, Michael Roth , hongyang.yang@easystack.cn This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --hrBSBtIsSu5tQQnaSkm3GEhxs9vhOfuKU Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 12/15/2015 01:22 AM, zhanghailiang wrote: > If some errors happen during VM's COLO FT stage, it's important to noti= fy the users > of this event. Together with 'colo_lost_heartbeat', users can intervene= in COLO's > 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 exited COLO mode. >=20 > Cc: Markus Armbruster > Cc: Michael Roth > Signed-off-by: zhanghailiang > Signed-off-by: Li Zhijian > --- > v11: > - Fix several typos found by Eric >=20 > Signed-off-by: zhanghailiang > --- > +++ b/docs/qmp-events.txt > @@ -184,6 +184,23 @@ Example: > Note: The "ready to complete" status is always reset by a BLOCK_JOB_ER= ROR > event. > =20 > +COLO_EXIT > +--------- > + > +Emitted when VM finishes COLO mode due to some errors happening or > +at the request of users. > + > +Data: > + > + - "mode": COLO mode, primary or secondary side (json-string) > + - "reason": the exit reason, internal error or external request. (js= on-string) > + - "error": error message (json-string, operation) s/operation/optional/ May want to word it as: - "error": error message for human consumption (json-string, optional) to point out that machines shouldn't parse it. > +++ b/migration/colo.c > @@ -18,6 +18,7 @@ > #include "qemu/error-report.h" > #include "qemu/sockets.h" > #include "migration/failover.h" > +#include "qapi-event.h" > =20 > /* colo buffer */ > #define COLO_BUFFER_BASE_SIZE (4 * 1024 * 1024) > @@ -349,6 +350,11 @@ static void colo_process_checkpoint(MigrationState= *s) > out: > if (ret < 0) { > error_report("%s: %s", __func__, strerror(-ret)); Unrelated: I mentioned in another thread that we may want to start thinking about adding error_report_errno(); this would be another client.= > +++ b/qapi-schema.json > @@ -778,6 +778,22 @@ > 'data': [ 'unknown', 'primary', 'secondary'] } > =20 > ## > +# @COLOExitReason > +# > +# The reason for a COLO exit > +# > +# @unknown: unknown reason > +# If we never return 'unknown', then it is not worth having it in the enum (we can always add it later if we find a reason to have it; but adding it now feels premature if the code base isn't using it). Otherwise looks okay to me. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --hrBSBtIsSu5tQQnaSkm3GEhxs9vhOfuKU 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/ iQEcBAEBCAAGBQJWdC5KAAoJEKeha0olJ0NqN6cH/RaU11ZyMqQX60Psov3EAlEu CWbKDWa06oWsm05J1ZXY6arWJ6PxdxFW0m7LgN1oH2SLdFxNENcShqWtHa/0BDXM Vtl1Q6jV6D7qz0jL88kxbtHZkWnY/Bqe6rw4tlyA3f+Wz/hGstrumqUNSblQZr7s 7/uUx4EGSwAvsgNnmtLkvcdu3FwLUuwJZHvbcC6cDXP73xFJpt75jYbANBPKI8tT 7fQQHcrh6AGrpGpYwOffSYusiq2QNOuFDixeD1YV8dZdhKpo3YxcPt1iUtXp3dWE CpsAFn2ECFkYc4ET3XJ9aITnvUpY8NeHHYMp06lgafp6Ox3VJ8Tj0OpoZpQZQ58= =IZBj -----END PGP SIGNATURE----- --hrBSBtIsSu5tQQnaSkm3GEhxs9vhOfuKU--