On 04/30/2014 10:26 PM, 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". > > The script mainly includes two parts: generate API for each event > define, generate an enum type for all defined events. > > Since in some cases the real emit behavior may change, for example, > qemu-img would not send a event, a callback layer is used to > control the behavior. As a result, the stubs at compile time > can be saved, the binding of block layer code and monitor code > will become looser. > > Signed-off-by: Wenchao Xia > --- > @@ -252,6 +252,9 @@ $(SRC_PATH)/qapi-schema.json $(SRC_PATH)/scripts/qapi-types.py $(qapi-py) > qapi-visit.c qapi-visit.h :\ > $(SRC_PATH)/qapi-schema.json $(SRC_PATH)/scripts/qapi-visit.py $(qapi-py) > $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-visit.py $(gen-out-type) -o "." -b < $<, " GEN $@") > +qapi-event.c qapi-event.h :\ > +$(SRC_PATH)/qapi-schema.json $(SRC_PATH)/scripts/qapi-event.py $(qapi-py) > + $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-event.py $(gen-out-type) -o "." -b < $<, " GEN $@") Long lines; I think you should rebase atop Lluís series. > + > + /* Fake visit, as if all member are under a structure */ > + visit_start_struct(v, NULL, "", "%(event_name)s", 0, &local_err); > + if (error_is_set(&local_err)) { > + goto clean; > + } s/error_is_set(&local_err)/local_err/ here and elsewhere. We are getting rid of error_is_set. > + > +# Start the real job > + > +try: > + opts, args = getopt.gnu_getopt(sys.argv[1:], "chbp:o:", > + ["source", "header", "builtins", "prefix=", > + "output-dir="]) Another reason to rebase atop Lluís work: this should take the input file name as a parameter rather than reading stdin. -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org