From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60638) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wx6ts-0002At-NL for qemu-devel@nongnu.org; Tue, 17 Jun 2014 23:51:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wx6to-0006LH-G8 for qemu-devel@nongnu.org; Tue, 17 Jun 2014 23:51:04 -0400 Received: from mx1.redhat.com ([209.132.183.28]:62918) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wx6to-0006L4-7C for qemu-devel@nongnu.org; Tue, 17 Jun 2014 23:51:00 -0400 Message-ID: <53A10C9D.2080201@redhat.com> Date: Tue, 17 Jun 2014 21:50:53 -0600 From: Eric Blake MIME-Version: 1.0 References: <1401970944-18735-1-git-send-email-wenchaoqemu@gmail.com> <1401970944-18735-4-git-send-email-wenchaoqemu@gmail.com> In-Reply-To: <1401970944-18735-4-git-send-email-wenchaoqemu@gmail.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="Jmqgnd2PNAK6Ll3aDVN0jppeHc4dLhEJV" Subject: Re: [Qemu-devel] [PATCH V6 03/29] 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) --Jmqgnd2PNAK6Ll3aDVN0jppeHc4dLhEJV Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 06/05/2014 06:21 AM, 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 > +def _generate_event_api_name(event_name, params): > + api_name =3D "void qapi_event_send_%s(" % c_fun(event_name).lower(= ); > + l =3D len(api_name) > + > + if params: > + for argname, argentry, optional, structured in parse_args(para= ms): > + if optional: > + api_name +=3D "bool has_%s,\n" % c_var(argname) > + api_name +=3D "".ljust(l) > + > + if argentry =3D=3D "str": > + api_name +=3D "const " > + api_name +=3D "%s %s,\n" % (c_type(argentry), c_var(argnam= e)) This may need to be rebased or have a followup patch based on Amos' work:= https://lists.gnu.org/archive/html/qemu-devel/2014-06/msg02387.html --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --Jmqgnd2PNAK6Ll3aDVN0jppeHc4dLhEJV 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/ iQEcBAEBCAAGBQJToQydAAoJEKeha0olJ0NqItEH/2uNh7jIEm4PTHAJPFq/t5De 8Bno5x5VFe5ZTzzO2W17e8rx3t6rKIcqS1icyra9gxxlxheM4nNvzRyBQioDfLi6 j63xj6oU47Zvv29Xmz873/eoQ7q5MGAI383++e0Qgap/L1J2miy7moj5jtBU2d5N cVDG+ZCkIIuD3C+O1WiJjJ4I8BZCyVdbEBlLLORkjOCLplhSp8NpEL1pysjulrP2 n5be3tOI7bBli4Hq+VNq+4TezbZRsscPC8/fD9oH9A4Y6JLPoxXnQUP41hBYdiUm DvMXyNzt2gOov9vxunXJzqtOS4zpowc/tDD1JmJYupWJV6AVNjj4qhjLLhWEgt0= =fMl5 -----END PGP SIGNATURE----- --Jmqgnd2PNAK6Ll3aDVN0jppeHc4dLhEJV--