]> git.proxmox.com Git - qemu.git/commitdiff
block: qed - use QEMU_PACKED for on-disk structures
authorJeff Cody <jcody@redhat.com>
Wed, 25 Sep 2013 16:08:51 +0000 (12:08 -0400)
committerKevin Wolf <kwolf@redhat.com>
Wed, 25 Sep 2013 18:51:15 +0000 (20:51 +0200)
QEDHeader is read, and written, directly from on-disk images
via bdrv_pread()/write().  To avoid any unintentional padding,
these structs should be packed.

Signed-off-by: Jeff Cody <jcody@redhat.com>
Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block/qed.h

index 2b4ddedf31373c43712e5339a217599cc859abe6..5d65bea075b65dbd590e707d0597892f9bd5e681 100644 (file)
@@ -100,7 +100,7 @@ typedef struct {
     /* if (features & QED_F_BACKING_FILE) */
     uint32_t backing_filename_offset; /* in bytes from start of header */
     uint32_t backing_filename_size;   /* in bytes */
-} QEDHeader;
+} QEMU_PACKED QEDHeader;
 
 typedef struct {
     uint64_t offsets[0];            /* in bytes */