From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51007) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZywPQ-0005mk-QC for qemu-devel@nongnu.org; Wed, 18 Nov 2015 01:40:01 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZywPM-00082h-QG for qemu-devel@nongnu.org; Wed, 18 Nov 2015 01:40:00 -0500 Received: from mx1.redhat.com ([209.132.183.28]:37724) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZywPM-00082d-Kd for qemu-devel@nongnu.org; Wed, 18 Nov 2015 01:39:56 -0500 References: <1447674737-32430-1-git-send-email-den@openvz.org> <564B4DB4.1070005@redhat.com> <564C1787.8040500@virtuozzo.com> From: Eric Blake Message-ID: <564C1D32.5070301@redhat.com> Date: Tue, 17 Nov 2015 23:39:46 -0700 MIME-Version: 1.0 In-Reply-To: <564C1787.8040500@virtuozzo.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="q2PIOrkkTXXQsnUERG3AvkOBo2TINoSL1" Subject: Re: [Qemu-devel] [PATCH 1/1] parallels: add format spec List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Vladimir Sementsov-Ogievskiy , "Denis V. Lunev" Cc: John Snow , qemu-devel@nongnu.org, Stefan Hajnoczi This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --q2PIOrkkTXXQsnUERG3AvkOBo2TINoSL1 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 11/17/2015 11:15 PM, Vladimir Sementsov-Ogievskiy wrote: >> You may want to compare to the qcow2 spec, which also lists expected >> byte offsets for each field (rather than having to count how many >> earlier fields of which widths were specified). >=20 > I've compared qed spec with qcow2 spec and like the first one. What the= > need of specifying each offset? Creating a c-structure is simpler when > you see types. and than offsetof and sizeof may be used if needed. > Nobody will #define numeric offsets I think. You'd be surprised (libvirt has some hard-coded numeric offsets: https://libvirt.org/git/?p=3Dlibvirt.git;a=3Dblob;f=3Dsrc/util/virstorage= file.c;h=3D2aa1d90;hb=3D5ed7afa9d#l159) Also, listing offsets makes it obvious that you are NOT relying on compiler padding, and makes it obvious whether you have been careful that all 64-bit quantities are 8-byte-aligned without wasting space. The original cow format (not qcow or qcow2) has the awful distinction of NOT having specified offsets, and had different layouts on 32-bit platforms than it did on 64-bit platforms; hence, we retired it in commit 550830f9 as unsupportable. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --q2PIOrkkTXXQsnUERG3AvkOBo2TINoSL1 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/ iQEcBAEBCAAGBQJWTB0yAAoJEKeha0olJ0NqPawH/A33Lb85E5OlTOg49XbFBDJX LI14NQvopDByUjXHYtZ116IDif3ytlwtrDNDAAwXg+Sca+8iboRjXtTLrv4Rvx85 LzNl/+prvRXXgR9MB1NSMyQIPxqFUed6ZW98OvNRxFZ1ekuhBCr/MTxNK4z1VHFn LFRBbFqvLImMWjbgesKDhis2TWoiAC351fPoTPQv+H4funb24A2mcrxldAdNEnF9 IE2hG6CSw4Wdok/pXLpO0uIYAPap+3KvLvtDU+ZZU59Qw1HDxVKdz38HwbqvH/vh 0vxBP0weDik3BPkCgJmhWYEM9m7TSeW5/hRlVRaMFv9L+EN6tJra3uKvlIfpZUo= =hTPx -----END PGP SIGNATURE----- --q2PIOrkkTXXQsnUERG3AvkOBo2TINoSL1--