diff --git a/block/qcow2.c b/block/qcow2.c index 318d95d972ef..4a9888cc7f91 100644 --- a/block/qcow2.c +++ b/block/qcow2.c @@ -52,7 +52,7 @@ typedef struct { uint32_t magic; uint32_t len; -} QCowExtension; +} QEMU_PACKED QCowExtension; #define QCOW2_EXT_MAGIC_END 0 #define QCOW2_EXT_MAGIC_BACKING_FORMAT 0xE2792ACA diff --git a/block/qcow2.h b/block/qcow2.h index c90e5d6c6e6c..455e38de64f1 100644 --- a/block/qcow2.h +++ b/block/qcow2.h @@ -86,7 +86,7 @@ typedef struct QCowHeader { uint32_t refcount_order; uint32_t header_length; -} QCowHeader; +} QEMU_PACKED QCowHeader; typedef struct QCowSnapshot { uint64_t l1_table_offset;