From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53154) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VYXnL-0001Uo-0j for qemu-devel@nongnu.org; Tue, 22 Oct 2013 04:58:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VYXnG-0006o9-43 for qemu-devel@nongnu.org; Tue, 22 Oct 2013 04:58:30 -0400 Received: from mx1.redhat.com ([209.132.183.28]:6758) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VYXnF-0006o0-QK for qemu-devel@nongnu.org; Tue, 22 Oct 2013 04:58:26 -0400 Message-ID: <52663E2C.7070905@redhat.com> Date: Tue, 22 Oct 2013 09:58:20 +0100 From: Eric Blake MIME-Version: 1.0 References: <1382321765-29052-1-git-send-email-xiawenc@linux.vnet.ibm.com> <1382321765-29052-7-git-send-email-xiawenc@linux.vnet.ibm.com> <526595ED.5090506@redhat.com> <52662165.8000300@linux.vnet.ibm.com> In-Reply-To: <52662165.8000300@linux.vnet.ibm.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="X4wj51rK2la1URpbwdTE6fdbHQOpEaUnK" Subject: Re: [Qemu-devel] [PATCH 6/6] qapi: add doc for QEvent List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Wenchao Xia , qemu-devel@nongnu.org Cc: kwolf@redhat.com, pbonzini@redhat.com, armbru@redhat.com, stefanha@redhat.com, lcapitulino@redhat.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --X4wj51rK2la1URpbwdTE6fdbHQOpEaUnK Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 10/22/2013 07:55 AM, Wenchao Xia wrote: > =E4=BA=8E 2013/10/22 5:00, Eric Blake =E5=86=99=E9=81=93: >> On 10/21/2013 03:16 AM, Wenchao Xia wrote: >>> Signed-off-by: Wenchao Xia >>> --- >>> qapi-schema.json | 56 >>> ++++++++++++++++++++++++++++++++++++++++++++++++++++++ >>> 1 files changed, 56 insertions(+), 0 deletions(-) >> Incomplete. Now that you are actually using the enum (see the spot I >> pointed out in 5/6), you ALSO need to change: >> >> -{ 'type': 'EventInfo', 'data': {'name': 'str'} } >> +{ 'type': 'EventInfo', 'data': {'name': 'QEvent'} } >> >> and make use of the enum in the QAPI documentation. >> > I just found QEvent is a int(enum) so this change can't be done. Huh? That's the whole point of qapi enums - they are stored as int constants in C code, but sent as strings over QMP. > Is there a way to tell use QEvent's correspond string? Add a new > way to specify enum's correspond string automatically? for example: >=20 > { 'type': 'EventInfo', 'data': {'name': '&QEvent'} No, QAPI does it for you already, no change in syntax needed. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --X4wj51rK2la1URpbwdTE6fdbHQOpEaUnK Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.15 (GNU/Linux) Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJSZj4sAAoJEKeha0olJ0NqjY4H/06K9jnmIv11ZskURNa9rnNV 1/AvIOdOnyxqeF4q1Ko/SZnpFUJM8rEMS7DWJYXruzgU+2u+96LMV1uIcjWf2jKC N0w/9kKU79x8fn0nMF38dZn157VGl1YAsVtVuEqSbqIv+y6eStL1SwHOMdbWNrtb JEcHV1x7CxjKgkyGgUOJNlkcYc56tnKRB5bChVJSOOLeQ5XZPFBGlj0rcbf8OWv1 eoQtpRG7V6+w7u2+i2ujVnd3YWX9Vrwlr3TIQTvqKOO2U5dQRlJyzuXKm8+YeW1K UXu/sActzuD4a40g1vRwU4z3ht3/w/J/idfAafjayEwgDGAHcdc88OqRMskGdI0= =U3gs -----END PGP SIGNATURE----- --X4wj51rK2la1URpbwdTE6fdbHQOpEaUnK--