From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39327) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ayeo7-0006FN-Jf for qemu-devel@nongnu.org; Fri, 06 May 2016 08:24:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ayenv-0000wC-ST for qemu-devel@nongnu.org; Fri, 06 May 2016 08:24:30 -0400 References: <1462406126-22946-1-git-send-email-eblake@redhat.com> <1462406126-22946-3-git-send-email-eblake@redhat.com> <20160506103728.GB5093@noname.redhat.com> From: Eric Blake Message-ID: <572C8CCA.4060508@redhat.com> Date: Fri, 6 May 2016 06:23:38 -0600 MIME-Version: 1.0 In-Reply-To: <20160506103728.GB5093@noname.redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="32mn3Mji2XuLvUEVW5NxlFJkfexvNaT3N" Subject: Re: [Qemu-devel] [PATCH v6 02/20] block: Drop private ioctl-only members of BlockRequest List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf Cc: qemu-devel@nongnu.org, qemu-block@nongnu.org, Stefan Hajnoczi , Fam Zheng , Max Reitz This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --32mn3Mji2XuLvUEVW5NxlFJkfexvNaT3N Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 05/06/2016 04:37 AM, Kevin Wolf wrote: > Am 05.05.2016 um 01:55 hat Eric Blake geschrieben: >> I was thrown by the fact that the public type BlockRequest had >> an anonymous union, but no obvious discriminator. Turns out >> that the only client of the second branch of the union was code >> internal to io.c, and that with a slight abuse of QEMUIOVector* >> to pass a void* pointer, we can make the public interface less >> confusing. >> >> (Yes, I know that strict C doesn't guarantee that you can cast >> void* to the wrong type and then back to void* - it only >> guarantees the reverse direction of the original pointer to >> void* and back to the original type - but we already have other >> assumptions throughout the qemu code base that assume that all >> pointers are interchangeable in representation). >> >> Signed-off-by: Eric Blake >=20 > Do you really think abusing fields makes things clearer than using a > union? We could just add comments instead that tell which branch is use= d > for what. And after my patch "block: Remove bdrv_aio_multiwrite()", I > think the struct isn't part of a public interface any more anyway. Oh, you're right! Consider this patch severed from the series (I may still send a documentation patch, and/or move the struct out of the public header into block_int.h, but it is sufficiently unrelated to the rest of the series). --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --32mn3Mji2XuLvUEVW5NxlFJkfexvNaT3N 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/ iQEcBAEBCAAGBQJXLIzKAAoJEKeha0olJ0NqrzsH/21QbLrn8hqroGp+rtpg43FX oTFeA2ZOa7d2vJvLTN56PXECEa87AY9GSrzrbbIkNMqZX7IJCb6ePmPM4Psdp9xj pWR6hzVhWc/oZu/HKlDj6SWTHv7n/s7EGpkaTbVWFu1boA065oDK1T7s0TUnVu6t tr18NlcOyVQA77gBP0KJNbXIt+0G/zUsXNSC4TiDGOmqgDvFG+mMhVCQJx59FeqL uPL6N0hvWAELkzEXprayOA++1/tOGr8s1h+bee7aCBXfEM1UxXiUu9tZA4nu25pD YlVqQF4V8G2IGEkRkDsy488HfNGzH4af4801tuA+UgzlIKU/PT6b/9Fd9XFh7WI= =5jdS -----END PGP SIGNATURE----- --32mn3Mji2XuLvUEVW5NxlFJkfexvNaT3N--