diff options
author | Kevin Wolf <kwolf@redhat.com> | 2014-05-07 16:56:10 +0200 |
---|---|---|
committer | Michael Roth <mdroth@linux.vnet.ibm.com> | 2014-07-20 22:29:09 -0500 |
commit | d234c8f1f6bb52be075581d8237d4683b942bbe3 (patch) | |
tree | 76e6b8cda920638480ffeacb9af480741045d41d | |
parent | 3ba1e617e7ae2b69a508a52b4f6cc301a9de95ce (diff) | |
download | qemu-d234c8f1f6bb52be075581d8237d4683b942bbe3.zip qemu-d234c8f1f6bb52be075581d8237d4683b942bbe3.tar.gz qemu-d234c8f1f6bb52be075581d8237d4683b942bbe3.tar.bz2 |
qcow1: Make padding in the header explicit
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 <kwolf@redhat.com>
Reviewed-by: Benoit Canet <benoit@irqsave.net>
(cherry picked from commit ea54feff58efedc809641474b25a3130309678e7)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
-rw-r--r-- | block/qcow.c | 3 |
1 files changed, 2 insertions, 1 deletions
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 |