From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51705) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZUcg4-0004Zd-Mq for qemu-devel@nongnu.org; Wed, 26 Aug 2015 11:31:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZUcg1-0006qK-Cj for qemu-devel@nongnu.org; Wed, 26 Aug 2015 11:31:52 -0400 Received: from mx1.redhat.com ([209.132.183.28]:42192) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZUcg1-0006qE-6I for qemu-devel@nongnu.org; Wed, 26 Aug 2015 11:31:49 -0400 References: <1440583182-5828-1-git-send-email-yanghy@cn.fujitsu.com> <1440583182-5828-3-git-send-email-yanghy@cn.fujitsu.com> <87zj1em7sy.fsf@blackfin.pond.sub.org> From: Eric Blake Message-ID: <55DDDBE3.9080505@redhat.com> Date: Wed, 26 Aug 2015 09:31:47 -0600 MIME-Version: 1.0 In-Reply-To: <87zj1em7sy.fsf@blackfin.pond.sub.org> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="H1C2h5rA2jFvPNMktOv01k8EOcdhJ7cwI" Subject: Re: [Qemu-devel] [PATCH v8 02/11] init/cleanup of netfilter object List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster , Yang Hongyang Cc: thuth@redhat.com, zhang.zhanghailiang@huawei.com, lizhijian@cn.fujitsu.com, jasowang@redhat.com, qemu-devel@nongnu.org, mrhines@linux.vnet.ibm.com, stefanha@redhat.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --H1C2h5rA2jFvPNMktOv01k8EOcdhJ7cwI Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 08/26/2015 08:41 AM, Markus Armbruster wrote: > Only reviewing the QAPI part. >=20 > Yang Hongyang writes: >=20 > Let's make this a flat union instead, to reduce nesting, and therefore > memory allocations and indirections. Something like >=20 > { 'enum': 'NetFilterType', > 'data': [] } >=20 > { 'struct': NetFilterBase', > 'data': { > 'id': 'str', > 'netdev': 'str', > '*chain': 'str', > 'type': 'NetFilterType' >=20 > { 'union': 'NetFilter', > 'base': 'NetFilterBase', > 'discriminator': 'type', > 'data': { > } > } >=20 > I hope to reduce the notational overhead of such flat unions in the nea= r > future. >=20 > Not sure empty unions actually work. If they don't, you can either > squash adding members into this patch, or add a dummy member, and drop > it when you add the real ones. The generator handles an empty union without compilation error, but creates C code that will always abort() if the union is passed on the wire. I have pending patches on top of Markus' that outlaw an empty unio= n: [uggh: https://lists.gnu.org/archive/html/qemu-devel/ is hosed right now, and it's harder to find messages on other archivers...] http://thread.gmane.org/gmane.comp.emulators.qemu/356265/focus=3D356258 http://thread.gmane.org/gmane.comp.emulators.qemu/356265/focus=3D356294 so a dummy member for now is a reasonable compromise. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --H1C2h5rA2jFvPNMktOv01k8EOcdhJ7cwI 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/ iQEcBAEBCAAGBQJV3dvjAAoJEKeha0olJ0Nq7bUIALDbSiorsIoucc5W7GTClN+7 D8ZWPCP2QjomXKORuGuuQ1qw2EN5BKLlK2Iunpk8v3GVGX7nx4lq/UkhczT1CnXo PY4XSmZOf40aMbEQkArYa4ImcxrTe6f3CEmTa/oyG+x7uFN8imJgTxdpfv+Kko4d eIAei5vfOU6WASA2tpYmmnaMlxXqUdKeu01BxXDFyn+AdIWpaDa+rRg897HVa587 ff7fQF/r11KRKZg6vKmxyrbYWwrRIRfpJdtq+iHdJJX3JvCG6nZmdfW6+95MMCkM KFhfwVn6s6VUM3nHtBCMJOuVVKvrqp4dM30BCLPidL50PGq7bxKRX2bpdJ8tQJY= =smIr -----END PGP SIGNATURE----- --H1C2h5rA2jFvPNMktOv01k8EOcdhJ7cwI--