[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH V5 03/28] qapi script: add event support
From: |
Markus Armbruster |
Subject: |
Re: [Qemu-devel] [PATCH V5 03/28] qapi script: add event support |
Date: |
Fri, 02 May 2014 09:54:02 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.2 (gnu/linux) |
Eric Blake <address@hidden> writes:
> 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 <address@hidden>
>> ---
>
>> @@ -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.
This one: "qapi: Allow modularization of QAPI schema files". v9 looked
committable to me, but Lluís decided to address minor review comments
right away. I haven't reviewed his v10, yet, but I expect it to be the
final one.
>> +
>> + /* 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.
Yes, please!
>> +
>> +# 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.
- [Qemu-devel] [PATCH V5 00/28] add direct support of event in qapi schema, Wenchao Xia, 2014/05/01
- [Qemu-devel] [PATCH V5 03/28] qapi script: add event support, Wenchao Xia, 2014/05/01
- [Qemu-devel] [PATCH V5 01/28] os-posix: include sys/time.h, Wenchao Xia, 2014/05/01
- [Qemu-devel] [PATCH V5 02/28] qapi: add event helper functions, Wenchao Xia, 2014/05/01
- [Qemu-devel] [PATCH V5 04/28] test: add test cases for qapi event, Wenchao Xia, 2014/05/01
- [Qemu-devel] [PATCH V5 05/28] qapi: define events in qapi schema, Wenchao Xia, 2014/05/01
- [Qemu-devel] [PATCH V5 06/28] monitor: change event functions as an implemention of new emit method, Wenchao Xia, 2014/05/01