[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: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH V5 03/28] qapi script: add event support |
Date: |
Thu, 01 May 2014 16:05:10 -0600 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 |
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.
> +
> + /* 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
signature.asc
Description: OpenPGP digital signature
- [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
- Re: [Qemu-devel] [PATCH V5 03/28] qapi script: add event support,
Eric Blake <=
- [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