Commit ea54feff authored by Kevin Wolf's avatar Kevin Wolf
Browse files

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: default avatarKevin Wolf <kwolf@redhat.com>
Reviewed-by: default avatarBenoit Canet <benoit@irqsave.net>
parent 0a86cb73
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -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