Received: from eggs.gnu.org ([2001:4830:134:3::10]:45355) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wg8IR-0002Lm-FY for qemu-devel@nongnu.org; Fri, 02 May 2014 03:54:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wg8IM-0004Nk-OE for qemu-devel@nongnu.org; Fri, 02 May 2014 03:54:15 -0400 Received: from mx1.redhat.com ([209.132.183.28]:10580) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wg8IM-0004Ne-Gm for qemu-devel@nongnu.org; Fri, 02 May 2014 03:54:10 -0400 From: Markus Armbruster References: <1398918422-3019-1-git-send-email-wenchaoqemu@gmail.com> <1398918422-3019-4-git-send-email-wenchaoqemu@gmail.com> <5362C516.1050804@redhat.com> Date: Fri, 02 May 2014 09:54:02 +0200 In-Reply-To: <5362C516.1050804@redhat.com> (Eric Blake's message of "Thu, 01 May 2014 16:05:10 -0600") Message-ID: <8738gsipk5.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH V5 03/28] qapi script: add event support List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake Cc: mdroth@linux.vnet.ibm.com, lcapitulino@redhat.com, Wenchao Xia , qemu-devel@nongnu.org Eric Blake 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". >>=20 >> The script mainly includes two parts: generate API for each event >> define, generate an enum type for all defined events. >>=20 >> 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. >>=20 >> Signed-off-by: Wenchao Xia >> --- > >> @@ -252,6 +252,9 @@ $(SRC_PATH)/qapi-schema.json $(SRC_PATH)/scripts/qap= i-types.py $(qapi-py) >> qapi-visit.c qapi-visit.h :\ >> $(SRC_PATH)/qapi-schema.json $(SRC_PATH)/scripts/qapi-visit.py $(qapi-p= y) >> $(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-p= y) >> + $(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=C3=ADs series. This one: "qapi: Allow modularization of QAPI schema files". v9 looked committable to me, but Llu=C3=ADs 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 =3D getopt.gnu_getopt(sys.argv[1:], "chbp:o:", >> + ["source", "header", "builtins", "prefix=3D", >> + "output-dir=3D"]) > > Another reason to rebase atop Llu=C3=ADs work: this should take the input > file name as a parameter rather than reading stdin.