From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35795) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZIFfY-0008Jg-Gs for qemu-devel@nongnu.org; Thu, 23 Jul 2015 08:32:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZIFfU-0003et-T5 for qemu-devel@nongnu.org; Thu, 23 Jul 2015 08:32:12 -0400 Received: from mx1.redhat.com ([209.132.183.28]:41422) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZIFfU-0003eX-Ob for qemu-devel@nongnu.org; Thu, 23 Jul 2015 08:32:08 -0400 References: <1435782155-31412-1-git-send-email-armbru@redhat.com> <1435782155-31412-30-git-send-email-armbru@redhat.com> From: Eric Blake Message-ID: <55B0DEC2.408@redhat.com> Date: Thu, 23 Jul 2015 06:32:02 -0600 MIME-Version: 1.0 In-Reply-To: <1435782155-31412-30-git-send-email-armbru@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="VefE0w2tqdl9qoAKpTEn9UWjE5PJN1qB1" Subject: Re: [Qemu-devel] [PATCH RFC v2 29/47] qapi: Replace dirty is_c_ptr() by method c_null() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster , qemu-devel@nongnu.org Cc: kwolf@redhat.com, berto@igalia.com, mdroth@linux.vnet.ibm.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --VefE0w2tqdl9qoAKpTEn9UWjE5PJN1qB1 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 07/01/2015 02:22 PM, Markus Armbruster wrote: > is_c_ptr() looks whether the end of the C text for the type looks like > a pointer. Works, but is fragile. >=20 > We now have a better tool: use QAPISchemaType method c_null(). The > initializers for non-pointers become prettier: 0, false or the > enumeration constant with the value 0 instead of {0}. >=20 > One place looks suspicious: we initialize pointers, but not > non-pointers. Either the initialization is superfluous and should be > deleted, or the non-pointers need it as well, or something subtle is > going on and needs a comment. Since I lack the time to figure it out > now, mark it FIXME. I commented on that in another mail - either we have a leak on failure (and need the initializer only for pointers), or we should add an assert (and don't need the initializer at all), depending on what semantics we want to enforce on all handler functions that set their error parameter. Probably worth cleaning that up in a separate pre-req patch. >=20 > Signed-off-by: Markus Armbruster > --- > scripts/qapi-commands.py | 19 +++++++------------ > scripts/qapi.py | 3 --- > 2 files changed, 7 insertions(+), 15 deletions(-) >=20 Nice reduction in size. If the marshal code FIXME disappears due to a separate cleanup, then the rest of this commit is good to go: Reviewed-by: Eric Blake --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --VefE0w2tqdl9qoAKpTEn9UWjE5PJN1qB1 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/ iQEcBAEBCAAGBQJVsN7CAAoJEKeha0olJ0Nq6gEH/j17IPwR67nvd2Ql+3/2CObB E1bhJ/zxJPgwfzrfJWr7smo7VzSXBq0CV1A5hSP26vWc1gc/no51poV2Oa0qeuaF 9qPw0orFzImYS29a3rAo+529uSWprX6Sxn+EE/fA2egRVVKnfE6N+1z4oEb9711U 8W4lEg654WlID3oOTSepBmKY7xUU14hFvrNPw1lVTdrw3e+AsotJTcHlO6HBssxf pSOEjxeAi45GxYpNbGKADtbcyGhMfqvK7XM48j7gIQdu4Meo8rP/lDtf5Kla/szT 80y1c86DeqR78pboEFVeKslb/cSuo19IpmqhqYDp3X0xGML+enuBdx8bY5ONIkI= =f/6T -----END PGP SIGNATURE----- --VefE0w2tqdl9qoAKpTEn9UWjE5PJN1qB1--