From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36162) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WhMOB-0000Fz-5B for qemu-devel@nongnu.org; Mon, 05 May 2014 13:09:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WhMO6-0001Cd-Nh for qemu-devel@nongnu.org; Mon, 05 May 2014 13:09:15 -0400 Received: from mx1.redhat.com ([209.132.183.28]:24584) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WhMO6-0001CX-Fv for qemu-devel@nongnu.org; Mon, 05 May 2014 13:09:10 -0400 Message-ID: <5367C5B1.9050900@redhat.com> Date: Mon, 05 May 2014 11:09:05 -0600 From: Eric Blake MIME-Version: 1.0 References: <1399034675-17844-1-git-send-email-armbru@redhat.com> <1399034675-17844-5-git-send-email-armbru@redhat.com> In-Reply-To: <1399034675-17844-5-git-send-email-armbru@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="nmDJ0fGs7QGjPhlLTJeFrxCCLisNfDOVm" Subject: Re: [Qemu-devel] [PATCH 04/13] qapi: Replace start_optional()/end_optional() by optional() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster , qemu-devel@nongnu.org Cc: vilanova@ac.upc.edu, pbonzini@redhat.com, akong@redhat.com, mdroth@linux.vnet.ibm.com, lcapitulino@redhat.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --nmDJ0fGs7QGjPhlLTJeFrxCCLisNfDOVm Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 05/02/2014 06:44 AM, Markus Armbruster wrote: > Semantics of end_optional() differ subtly from the other end_FOO() > callbacks: when start_FOO() succeeds, the matching end_FOO() gets > called regardless of what happens in between. end_optional() gets > called only when everything in between succeeds as well. Entirely > undocumented, like all of the visitor API. >=20 > The only user of Visitor Callback end_optional() never did anything, > and was removed in commit 9f9ab46. >=20 > I'm about to clean up error handling in the generated visitor code, > and end_optional() is in my way. No users mean no test cases, and > making non-trivial cleanup transformations without test cases doesn't > strike me as a good idea. >=20 > Drop end_optional(), and rename start_optional() to optional(). We > can always go back to a pair of callbacks when we have an actual need. >=20 > Signed-off-by: Markus Armbruster > --- > include/qapi/visitor-impl.h | 5 ++--- > include/qapi/visitor.h | 5 ++--- > qapi/opts-visitor.c | 5 ++--- > qapi/qapi-visit-core.c | 15 ++++----------- > qapi/qmp-input-visitor.c | 6 +++--- > qapi/string-input-visitor.c | 6 +++--- > scripts/qapi-commands.py | 5 ++--- > scripts/qapi-visit.py | 3 +-- > 8 files changed, 19 insertions(+), 31 deletions(-) Reviewed-by: Eric Blake > +++ b/qapi/opts-visitor.c > @@ -483,8 +483,7 @@ opts_type_size(Visitor *v, uint64_t *obj, const cha= r *name, Error **errp) > =20 > =20 > static void > -opts_start_optional(Visitor *v, bool *present, const char *name, > - Error **errp) > +opts_optional(Visitor *v, bool *present, const char *name, Error **err= p) Managed to fix an indentation problem while at it :) --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --nmDJ0fGs7QGjPhlLTJeFrxCCLisNfDOVm 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/ iQEcBAEBCAAGBQJTZ8WxAAoJEKeha0olJ0NqCroH/3489UXBaDyKOvGNJiN97rbD E/uCkQYXvxyjWnvl9Vwwi9u/ZhuXr+8/ZbiU/Ygf55qvB+i3BiGbOV9MZFxAPp1u e1aJrMzAt+B0y9GGnghycPsyMlj+rqDYyGJMnndwIuFvVxLylKQVGiKwtn95UqIB X7MEidCfT1n84EOpETLCEeIeWV5CIt4MZ0L5CHbPQ0bTMGqxXMjjvRVp2pRoolaA bRmPepyXGML50wkH9yHG7lI6M6kk6A1ROiWUy2M/QCNnk2UAtnfqMX3VxcAj4ard I51gSWSDB8Xm1kLjdtiasook4VTTQPaPrfNnG0wDWEnPFrpTIRaKckStgKd1Pus= =ic85 -----END PGP SIGNATURE----- --nmDJ0fGs7QGjPhlLTJeFrxCCLisNfDOVm--