From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51421) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aYEv4-0001iI-25 for qemu-devel@nongnu.org; Tue, 23 Feb 2016 10:30:34 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aYEv0-0002Ij-Bs for qemu-devel@nongnu.org; Tue, 23 Feb 2016 10:30:34 -0500 Received: from mx1.redhat.com ([209.132.183.28]:37437) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aYEv0-0002IY-6q for qemu-devel@nongnu.org; Tue, 23 Feb 2016 10:30:30 -0500 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (Postfix) with ESMTPS id 91CAD33A896 for ; Tue, 23 Feb 2016 15:30:29 +0000 (UTC) References: <1455884286-26272-1-git-send-email-armbru@redhat.com> <1455884286-26272-15-git-send-email-armbru@redhat.com> <20160223145039.GH22780@redhat.com> <56CC785F.9020708@redhat.com> From: Eric Blake Message-ID: <56CC7B14.804@redhat.com> Date: Tue, 23 Feb 2016 08:30:28 -0700 MIME-Version: 1.0 In-Reply-To: <56CC785F.9020708@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="mFAUGKqpKsQ2MOEnBK5ujFlVAxsliwcW0" Subject: Re: [Qemu-devel] [PULL 14/15] qapi: Don't box branches of flat unions List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Daniel P. Berrange" , Markus Armbruster Cc: qemu-devel@nongnu.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --mFAUGKqpKsQ2MOEnBK5ujFlVAxsliwcW0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 02/23/2016 08:18 AM, Eric Blake wrote: >> >> I could visit_type_QCryptoBlockOptionsLUKS_fields(v, opts.u.luks, errp= ) >> but the '_fields' methods are all declared static in qapi-visit.c >> preventing their use. >> >> IMHO, now that QAPI inlines the flat unions, we should be making >> the _fields() methods public. >=20 > But my suggestion would just be a hack. Yours makes more sense in the > long run, so I'll go ahead and propose that patch. Another alternative, but not my preference (mentioning only for completeness): We could change the contract of visit_type_FOO(&obj) to say that if it points to non-NULL, we just visit the fields in place. All callers would then be required to set *obj =3D NULL prior to visit_type_FOO(&obj)= for existing semantics, and you would set *obj =3D &parent.u.luks for new= semantics. But this would entail an audit of existing callers (too many are passing uninitialized pointers, which must now be initialized), and feels a bit too complex. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --mFAUGKqpKsQ2MOEnBK5ujFlVAxsliwcW0 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/ iQEcBAEBCAAGBQJWzHsUAAoJEKeha0olJ0NqFPAH/jpVHg4MtViVS4f5PbWJ32P7 ht8pZgkN7j200uYMsXeljdC/NFBTuLbRzt0xVj6CbV112w5jNR8zqpozLBDBLx8u FWjRC4icaERI7kU1Tj9i/3pu7lOMJa7Sp5mUhfubkyC47l21Bd64jAnPJrw6S+Yx Oa8v9FWX8xhewJbwkzpXsx+bRfhjqdnZB0sp9FV4JRZojvKrc0c3K8y1ue3GK97+ vc5NsnPatugCOJ9sg8h5Tk6ODpUV7svmt71SzMmXxKaUaEMcd91wmp5wCDfe9tbu N7dsge1lOGiK9bJVqTlO0IP8IP0zT2MGTcCOA4dTUdFsyXi9ChsMslB5j18yB8Q= =3yTq -----END PGP SIGNATURE----- --mFAUGKqpKsQ2MOEnBK5ujFlVAxsliwcW0--