From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49227) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a7O72-00035m-Tk for qemu-devel@nongnu.org; Fri, 11 Dec 2015 08:52:01 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a7O6x-0003c7-N8 for qemu-devel@nongnu.org; Fri, 11 Dec 2015 08:51:56 -0500 References: <1449546921-6378-1-git-send-email-eblake@redhat.com> <1449546921-6378-14-git-send-email-eblake@redhat.com> From: Eric Blake Message-ID: <566AD4F4.70109@redhat.com> Date: Fri, 11 Dec 2015 06:51:48 -0700 MIME-Version: 1.0 In-Reply-To: <1449546921-6378-14-git-send-email-eblake@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="NkMuiVKONGgut9AS5RbRdQjJBB1l9el7c" Subject: Re: [Qemu-devel] [PATCH v7 13/31] qapi: Drop unused 'kind' for struct/enum visit List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: "Michael S. Tsirkin" , armbru@redhat.com, Michael Roth , Alexander Graf , "open list:sPAPR pseries" , Paolo Bonzini , Luiz Capitulino , =?UTF-8?Q?Andreas_F=c3=a4rber?= , David Gibson This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --NkMuiVKONGgut9AS5RbRdQjJBB1l9el7c Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 12/07/2015 08:55 PM, Eric Blake wrote: > visit_start_struct() and visit_type_enum() had a 'kind' argument > that was usually set to either the stringized version of the > corresponding qapi type name, or to NULL (although some clients > didn't even get that right). But nothing ever used the argument. > It's even hard to argue that it would be useful in a debugger, > as a stack backtrace also tells which type is being visited. >=20 > Therefore, drop the 'kind' argument as dead. While at it, change > the signature of visit_start_struct() to place the 'name' > argument at the end (other than 'errp'), and the 'size' argument > next to 'obj'; this placement of 'name' matches matches how all > other functions in visit.h do it (visit_type_enum() places > 'strings' between 'obj' and 'name'; visit_get_next_type() places > 'promote_int' between 'type' and 'name'). This also avoids the > confusion caused by splitting related pieces of information, > where the old signature an unrelated parameter in between the > "typename" and sizeof(typename) arguments. I should probably spell it out better in the commit message; I was going from: visit_start_struct(v, obj, [kind,] name, size, err) to: visit_start_struct(v, obj, size, [kind,] name, err) then dropping kind as unused. But I'm seriously thinking about doing the argument shuffle in the opposite direction (move name earlier, rather than later): visit_start_struct(v, name, obj, [kind,] size, err) with a global coccinelle patch that changes ALL visit_type_* to put name before obj, because after all we are tying this to JSON which uses "name":value and it looks odd that every one of our visitor functions takes parameters in 'value, name' order. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --NkMuiVKONGgut9AS5RbRdQjJBB1l9el7c 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/ iQEcBAEBCAAGBQJWatT0AAoJEKeha0olJ0Nq+UsIAJXRye9KIDzW9alCcehDTWUj b6jcvzHTyDpWXcDsJ7RN/y7lYlf2CgU29QRTgLIlUhAavEa1/cjOjoKtgXq3i+tt 9P7aA6+Vk74dS0wbw+CmfHFE1dTnGve/QgyrUjwFgMe/OA+HXLPLByQmi1qCdA+l 5lMFQ1vZcctvLb56tteVxp9df77L35v3d5BjXBNA+0Hb4PdPlcctYvpDcgX+nBnX /a9rVVNUUCY59SVCmT2pCRDC7Ll+d5Ae/mXqB8To78tLeZxvGUR7r57KJZQgGD5b 5fmBPZSAWZjlxY8gjgspqMoREA0X3l7MXfXwVKJXz2GaUYir2LkPiIK5qJMhIkY= =kMIN -----END PGP SIGNATURE----- --NkMuiVKONGgut9AS5RbRdQjJBB1l9el7c--