From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39729) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wfz6V-000817-BT for qemu-devel@nongnu.org; Thu, 01 May 2014 18:05:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wfz6R-0002Wn-0e for qemu-devel@nongnu.org; Thu, 01 May 2014 18:05:19 -0400 Received: from mx1.redhat.com ([209.132.183.28]:22521) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wfz6Q-0002Wj-OR for qemu-devel@nongnu.org; Thu, 01 May 2014 18:05:14 -0400 Message-ID: <5362C516.1050804@redhat.com> Date: Thu, 01 May 2014 16:05:10 -0600 From: Eric Blake MIME-Version: 1.0 References: <1398918422-3019-1-git-send-email-wenchaoqemu@gmail.com> <1398918422-3019-4-git-send-email-wenchaoqemu@gmail.com> In-Reply-To: <1398918422-3019-4-git-send-email-wenchaoqemu@gmail.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="4iu1FlF83jFmiNtn26H24VgvcSmR9suDn" 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: Wenchao Xia , qemu-devel@nongnu.org Cc: mdroth@linux.vnet.ibm.com, armbru@redhat.com, lcapitulino@redhat.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --4iu1FlF83jFmiNtn26H24VgvcSmR9suDn Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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/qa= pi-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 $(ge= n-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 $(ge= n-out-type) -o "." -b < $<, " GEN $@") Long lines; I think you should rebase atop Llu=C3=ADs 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 =3D getopt.gnu_getopt(sys.argv[1:], "chbp:o:", > + ["source", "header", "builtins", "p= refix=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. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --4iu1FlF83jFmiNtn26H24VgvcSmR9suDn Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJTYsUWAAoJEKeha0olJ0NqTXMH/25UunG2hkR1tvc9t2YEuvuq X9eSQZ98a2ZI/8RvtFgGX9kMA8jYx0DzvWTI79EGUBJIbyA6STNGl+Wxnv/+VYO+ Vime8DIN1WkB5nF3C7iAOzKFI0rJoPaHBnqGSOP3WV0KkICxadNjdzARQGfzIUsl q4WTo3BIhzlDP8MamLERtsCt38ys6ECIQ08JdNK92piQwZsU8ucSK9IJFTyJzQEQ kIYD0NrXpHU2TESBzzsjWzdq82Ce0ucfXD0Y/cR7oTuBp/RhDjBuf3i62fxtRd/Y Drqett+1Na9Vy/Pbs0wSvj6Anbd/kwtLQnJ8JGYoSTbFVoFzPXef/dMSpVVGWUQ= =Cbr0 -----END PGP SIGNATURE----- --4iu1FlF83jFmiNtn26H24VgvcSmR9suDn--