Skip to content

Commit

Permalink
block: qed - use QEMU_PACKED for on-disk structures
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-by: Richard Henderson <[email protected]>
Signed-off-by: Kevin Wolf <[email protected]>
  • Loading branch information
codyprime authored and kevmw committed Sep 25, 2013
1 parent c4217f6 commit 687fb89
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion block/qed.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down

0 comments on commit 687fb89

Please sign in to comment.