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
signature.asc
Description: OpenPGP digital signature