qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH V6 03/29] qapi script: add event support


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH V6 03/29] qapi script: add event support
Date: Fri, 13 Jun 2014 15:28:13 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0

On 06/05/2014 06:21 AM, Wenchao Xia wrote:
> qapi-event.py will parse the schema and generate qapi-event.c, then
> the API in qapi-event.c can be used to handle event in qemu code.
> All API have prefix "qapi_event".
> 

As promised, a revisit of the generator code now that I've looked at
more of it in use.  And since I've identified enough elsewhere that
warrants a series respin to v7, you should squash in fixes for these issues:

> +++ b/scripts/qapi-event.py

> +
> +def generate_event_implement(api_name, event_name, params):
> +    # step 1: declare and variables

s/and/any/


> +
> +    /* Fake visit, as if all member are under a structure */

s/member/members/

See also my comments on 16/29 - what if you change the generator to use
&error_abort instead of futzing around with local_error?  After all, the
qmp_output_visitor doesn't ever set errp; and all of your callers
silently ignore errp even if it were to be set.  Which makes sense,
since events are best-effort anyways (it's not like you are building up
a reply to a synchronous command, so you really don't have anyone to
inform about the failed event short of sending yet another event - but
if the first event failed, then your attempt to send another event to
inform about the failure is probably doomed).

-- 
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]