From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41393) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aGTbU-0001CJ-Sm for qemu-devel@nongnu.org; Tue, 05 Jan 2016 10:32:57 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aGTbP-0003Mz-Vm for qemu-devel@nongnu.org; Tue, 05 Jan 2016 10:32:56 -0500 References: <1450717720-9627-1-git-send-email-eblake@redhat.com> <1450717720-9627-15-git-send-email-eblake@redhat.com> From: Eric Blake Message-ID: <568BE21F.6040300@redhat.com> Date: Tue, 5 Jan 2016 08:32:47 -0700 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="NiWKwknaHLfDJLq6gqCgblkaELGsDTrjX" Subject: Re: [Qemu-devel] [PATCH v8 14/35] qapi: Swap visit_* arguments for consistent 'name' placement List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?UTF-8?Q?Marc-Andr=c3=a9_Lureau?= Cc: Kevin Wolf , =?UTF-8?Q?Andreas_F=c3=a4rber?= , Eduardo Habkost , "open list:Block layer core" , "Michael S. Tsirkin" , Markus Armbruster , Jason Wang , Richard Henderson , QEMU , Alexander Graf , Keith Busch , Gonglei , "open list:sPAPR pseries" , Gerd Hoffmann , Igor Mammedov , Paolo Bonzini , Luiz Capitulino , Jiri Slaby , Michael Roth , John Snow , David Gibson This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --NiWKwknaHLfDJLq6gqCgblkaELGsDTrjX Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 01/05/2016 07:06 AM, Marc-Andr=C3=A9 Lureau wrote: > Reviewed-by: Marc-Andr=C3=A9 Lureau Hi >=20 > On Mon, Dec 21, 2015 at 6:08 PM, Eric Blake wrote: >> JSON uses "name":value, but many of our visitor interfaces were >> called with visit_type_FOO(v, &value, name, errp). This can be >> a bit confusing to have to mentally swap the parameter order to >> match JSON order. It's particularly bad for visit_start_struct(), >> where the 'name' parameter is smack in the middle of the >> otherwise-related group of 'obj, kind, size' parameters! It's >> time to do a global swap of the parameter ordering, so that the >> 'name' parameter is always immediately after the Visitor argument. >> >=20 > fwiw, I do agree. >=20 >> Additional reasons in favor of the swap: name is always an input >> parameter, while &value is sometimes an output parameter (depending >> on whether the caller is using an input visitor); and it is nicer >> to list input parameters first. Also, the existing include/qjson.h >> prefers listing 'name' first in json_prop_*(), and I have plans to >> unify that file with the qapi visitors; listing 'name' first in >> qapi will minimize churn to the (admittedly few) qjson.h clients. >> >> The next patches will then fix object.h, visitor-impl.h, and those >> clients to match. >> >=20 > The result looks good and passes the tests > Reviewed-by: Marc-Andr=C3=A9 Lureau >=20 > However, docs/qapi-code-gen.txt should be updated in a follow-up patch.= D'oh - I knew I'd forget something :) You're right, of course. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --NiWKwknaHLfDJLq6gqCgblkaELGsDTrjX Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJWi+IfAAoJEKeha0olJ0NqKLkIAJByXrOrlyJK8Uvbd2ZFsxpE O+FbwdoCNnOwQWuGqROm9+CdrmsNntSR77UIhfbNI6URcST3Wgcvpni78E4dB+az kP0mPjZtKjgE0/jk2rQORvazMZf6nv5eqwTeXD2Z6eIpL1aFK3LoSZolY/QTEjNI ZJwtHEL0TvA/E4Rd8Zagi1OACb5OrFlTj9sd4siMBqLQLCT0TA8p1WtHMcFJ2KPf Jv/PB637ZoxdVAFZmbjXtwozUSgSPfqm3+VRB2NEsnrSQesNAvYpoyBI1tCE7usX F/9xUuJVGK0yXOCUCd5fxZP5nZemo8BvAcvm0ufX1J5bpS3tp/mdbvyNxvtqGps= =3WIU -----END PGP SIGNATURE----- --NiWKwknaHLfDJLq6gqCgblkaELGsDTrjX--