From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37970) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XF82u-00087f-HH for qemu-devel@nongnu.org; Wed, 06 Aug 2014 16:43:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XF82l-0005EJ-E7 for qemu-devel@nongnu.org; Wed, 06 Aug 2014 16:42:52 -0400 Received: from e34.co.us.ibm.com ([32.97.110.152]:50817) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XF82k-0005E8-UV for qemu-devel@nongnu.org; Wed, 06 Aug 2014 16:42:43 -0400 Received: from /spool/local by e34.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 6 Aug 2014 14:42:42 -0600 From: Michael Roth Date: Wed, 6 Aug 2014 15:38:55 -0500 Message-Id: <1407357598-21541-46-git-send-email-mdroth@linux.vnet.ibm.com> In-Reply-To: <1407357598-21541-1-git-send-email-mdroth@linux.vnet.ibm.com> References: <1407357598-21541-1-git-send-email-mdroth@linux.vnet.ibm.com> Subject: [Qemu-devel] [PATCH 045/108] qcow1: Make padding in the header explicit List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org From: Kevin Wolf 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. Cc: qemu-stable@nongnu.org Signed-off-by: Kevin Wolf Reviewed-by: Benoit Canet (cherry picked from commit ea54feff58efedc809641474b25a3130309678e7) Signed-off-by: Michael Roth --- block/qcow.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/block/qcow.c b/block/qcow.c index d5a7d5f..9018f44 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; #define L2_CACHE_SIZE 16 -- 1.9.1