From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41203) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WjrNN-0006Lv-JN for qemu-devel@nongnu.org; Mon, 12 May 2014 10:38:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WjrNH-0000YF-9O for qemu-devel@nongnu.org; Mon, 12 May 2014 10:38:45 -0400 Received: from lputeaux-656-01-25-125.w80-12.abo.wanadoo.fr ([80.12.84.125]:47743 helo=paradis.irqsave.net) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WjrNH-0000Xy-47 for qemu-devel@nongnu.org; Mon, 12 May 2014 10:38:39 -0400 Date: Mon, 12 May 2014 16:39:12 +0200 From: =?iso-8859-1?Q?Beno=EEt?= Canet Message-ID: <20140512143911.GD7858@irqsave.net> References: <1399899851-5641-1-git-send-email-kwolf@redhat.com> <1399899851-5641-2-git-send-email-kwolf@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <1399899851-5641-2-git-send-email-kwolf@redhat.com> Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 1/5] qcow1: Make padding in the header explicit List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf Cc: qemu-devel@nongnu.org, stefanha@redhat.com, ppandit@redhat.com The Monday 12 May 2014 =E0 15:04:07 (+0200), Kevin Wolf wrote : > We were relying on all compilers inserting the same padding in the > header struct that is used for the on-disk format. Let's not do that. > Mark the struct as packed and insert an explicit padding field for > compatibility. >=20 > Signed-off-by: Kevin Wolf > --- > block/qcow.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) >=20 > diff --git a/block/qcow.c b/block/qcow.c > index 937dd6d..3684794 100644 > --- a/block/qcow.c > +++ b/block/qcow.c > @@ -48,9 +48,10 @@ typedef struct QCowHeader { > uint64_t size; /* in bytes */ > uint8_t cluster_bits; > uint8_t l2_bits; > + uint16_t padding; > uint32_t crypt_method; > uint64_t l1_table_offset; > -} QCowHeader; > +} QEMU_PACKED QCowHeader; > =20 > #define L2_CACHE_SIZE 16 > =20 > --=20 > 1.8.3.1 >=20 >=20 Reviewed-by: Benoit Canet