qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 6/6] qapi: add doc for QEvent


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH 6/6] qapi: add doc for QEvent
Date: Tue, 22 Oct 2013 09:58:20 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.0

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 <address@hidden>
>>> ---
>>>   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

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]