On 10/22/2013 07:55 AM, Wenchao Xia wrote: > δΊ 2013/10/22 5:00, Eric Blake ει: >> On 10/21/2013 03:16 AM, Wenchao Xia wrote: >>> Signed-off-by: Wenchao Xia <xiaw...@linux.vnet.ibm.com> >>> --- >>> 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: > > { 'type': 'EventInfo', 'data': {'name': '&QEvent'} No, QAPI does it for you already, no change in syntax needed. -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature