Received: from eggs.gnu.org ([2001:4830:134:3::10]:41705) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X4Z72-0004xr-2R for qemu-devel@nongnu.org; Tue, 08 Jul 2014 13:24:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X4Z6G-0000yw-3M for qemu-devel@nongnu.org; Tue, 08 Jul 2014 13:23:27 -0400 Received: from e32.co.us.ibm.com ([32.97.110.150]:38954) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X4Z6F-0000x2-R6 for qemu-devel@nongnu.org; Tue, 08 Jul 2014 13:22:40 -0400 Received: from /spool/local by e32.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 8 Jul 2014 11:22:39 -0600 From: Michael Roth Date: Tue, 8 Jul 2014 12:18:27 -0500 Message-Id: <1404839947-1086-117-git-send-email-mdroth@linux.vnet.ibm.com> In-Reply-To: <1404839947-1086-1-git-send-email-mdroth@linux.vnet.ibm.com> References: <1404839947-1086-1-git-send-email-mdroth@linux.vnet.ibm.com> Subject: [Qemu-devel] [PATCH 116/156] 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 c470e05..1ca04e6 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