From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60444) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yv6SI-0006Av-Ee for qemu-devel@nongnu.org; Wed, 20 May 2015 12:02:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Yv6SC-00072e-Sw for qemu-devel@nongnu.org; Wed, 20 May 2015 12:02:50 -0400 Received: from mx1.redhat.com ([209.132.183.28]:46436) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yv6SC-00072U-MU for qemu-devel@nongnu.org; Wed, 20 May 2015 12:02:44 -0400 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t4KG2hQo012176 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Wed, 20 May 2015 12:02:43 -0400 Message-ID: <555CB022.50901@redhat.com> Date: Wed, 20 May 2015 10:02:42 -0600 From: Eric Blake MIME-Version: 1.0 References: <1432136124-24572-1-git-send-email-quintela@redhat.com> <1432136124-24572-3-git-send-email-quintela@redhat.com> In-Reply-To: <1432136124-24572-3-git-send-email-quintela@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="5ioekUltxgGh7qOIahsuA5wOdHmcci32G" Subject: Re: [Qemu-devel] [PATCH 2/3] migration: create migration event List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Juan Quintela , qemu-devel@nongnu.org Cc: amit.shah@redhat.com, jdenemar@redhat.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --5ioekUltxgGh7qOIahsuA5wOdHmcci32G Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 05/20/2015 09:35 AM, Juan Quintela wrote: > We have one argument that tells us what event has happened. >=20 > Signed-off-by: Juan Quintela > --- > docs/qmp/qmp-events.txt | 16 ++++++++++++++++ > migration/migration.c | 12 ++++++++++++ > qapi/event.json | 14 ++++++++++++++ > 3 files changed, 42 insertions(+) >=20 > diff --git a/docs/qmp/qmp-events.txt b/docs/qmp/qmp-events.txt > index 4c13d48..3797709 100644 > --- a/docs/qmp/qmp-events.txt > +++ b/docs/qmp/qmp-events.txt > @@ -473,6 +473,22 @@ Example: > { "timestamp": {"seconds": 1290688046, "microseconds": 417172}, > "event": "SPICE_MIGRATE_COMPLETED" } >=20 > +MIGRATION > +--------- > + > +Emitted when a migration event happens > + > +Data: None. > + > + - "status": migration status > + "": error has been ignored Uggh. Looking for an empty string is awkward. > + "report": error has been reported to the device > + "stop": the VM is going to stop because of the error > + > +Example: > + > +{"timestamp": {"seconds": 1432121972, "microseconds": 744001}, > + "event": "MIGRATION", "data": {"status": "completed"}} The example lists "completed", but the documentation does not mention it. Might be good to expand the docs to mention all states, and/or point to the enum definition. > +++ b/qapi/event.json > @@ -243,6 +243,20 @@ > { 'event': 'SPICE_MIGRATE_COMPLETED' } >=20 > ## > +# @MIGRATION > +# > +# Emitted when a migration event happens > +# > +# @status: @MigrationStatus describing the current migration status. > +# If this field is not returned, no migration process > +# has been initiated Rather than returning an empty string,... > +# > +# Since: 2.4 > +## > +{ 'event': 'MIGRATION', > + 'data': {'status': 'MigrationStatus'}} =2E..this field should be marked optional, as in '*status'. Then in your= callers, you'll have to pass true or false for has_status, so that you can omit status when there is none. But really, when will this event ever be omitted if migration has not been initiated? Maybe it is just bogus documentation that you can return an empty string, as I didn't see any addition of a call to qapi_event_send_migration() that would pass an empty string on the wire. So it sounds to me like the interface is okay, but the documentation is wrong. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --5ioekUltxgGh7qOIahsuA5wOdHmcci32G 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/ iQEcBAEBCAAGBQJVXLAiAAoJEKeha0olJ0NqShEH/1i9SiI9dW1mA/rjDpZ59Xom 33cASgD+7bjxHqoKkfVGRbHm7GRl+uNCzs09GZrYI0sW3CM6RY+F7bzwDg1ELtV2 u3552/34Cj6trv8ofR0o8h4RSynsLhxysZ9iRuk29QmN+ML7PNieQgDoVmxzsMvY TM/zrr2EbQ+Y4ICZ3KFRGx9OqdtG1hBNk9HkulikdCYzexByHZ6gtJpnQUxIF8HU VAiOdXGWzg3WaGrjemNB/ghzl0FTV0OSeeQLj9ZHQg5+4oenHYRQ5b2IhdMylPYs mnXLMiGK9Ic1GJ19icyv9YbuHuKuw+wVVmnzCMEab8Zx+8yEgQglMmy+842P4/4= =Q5mh -----END PGP SIGNATURE----- --5ioekUltxgGh7qOIahsuA5wOdHmcci32G--