From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58258) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WvZ1K-0006nr-5c for qemu-devel@nongnu.org; Fri, 13 Jun 2014 17:28:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WvZ1F-0000bs-Go for qemu-devel@nongnu.org; Fri, 13 Jun 2014 17:28:22 -0400 Received: from mx1.redhat.com ([209.132.183.28]:23893) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WvZ1F-0000bo-07 for qemu-devel@nongnu.org; Fri, 13 Jun 2014 17:28:17 -0400 Message-ID: <539B6CED.1090404@redhat.com> Date: Fri, 13 Jun 2014 15:28:13 -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="UQlw9hrJexPkEHL9p3PsGanvQHrQOG1T7" 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) --UQlw9hrJexPkEHL9p3PsGanvQHrQOG1T7 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 As promised, a revisit of the generator code now that I've looked at more of it in use. And since I've identified enough elsewhere that warrants a series respin to v7, you should squash in fixes for these issu= es: > +++ b/scripts/qapi-event.py > + > +def generate_event_implement(api_name, event_name, params): > + # step 1: declare and variables s/and/any/ > + > + /* Fake visit, as if all member are under a structure */ s/member/members/ See also my comments on 16/29 - what if you change the generator to use &error_abort instead of futzing around with local_error? After all, the qmp_output_visitor doesn't ever set errp; and all of your callers silently ignore errp even if it were to be set. Which makes sense, since events are best-effort anyways (it's not like you are building up a reply to a synchronous command, so you really don't have anyone to inform about the failed event short of sending yet another event - but if the first event failed, then your attempt to send another event to inform about the failure is probably doomed). --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --UQlw9hrJexPkEHL9p3PsGanvQHrQOG1T7 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/ iQEcBAEBCAAGBQJTm2ztAAoJEKeha0olJ0Nq4RAH/RaMqpckoj3uo4jcli7Di90l jdu50tvXxfeQkDY4D2vU3HRN+eayYTcVL7VPqKtkWFe/NhNG+70K0e8ZfDkvZXQD SmbltBJauV6kW8R1j6OHaxGpNGhWLM7J90tS3MSAET3ugqYQNo4YbY0MuxIbbm9l IqtuwKCHEM15Brvx0gWhHSG1Vo+qoKF8pZwV3+HA2FQ22zF5gYNlAqNiN6Z5JelY 7IH1N9nI6BNV4iXg4nQLnW7NzybaY4d7dRf95Paw8BetKSn45V3v8jsBtxvDgslQ 6y8tNl+w98BbNn1XurDkbUxORId9KPqk0qUPsHBQJXULspB4DBNWVN3OwQ65iBY= =ncpG -----END PGP SIGNATURE----- --UQlw9hrJexPkEHL9p3PsGanvQHrQOG1T7--