diff --git a/hw/xen_blkif.h b/hw/xen_blkif.h index 738b8fe..bb4ff02 100644 --- a/hw/xen_blkif.h +++ b/hw/xen_blkif.h @@ -16,8 +16,9 @@ struct blkif_common_response { char dummy; }; +/* XXX move this into a proper header */ +#define __aligned(x) __attribute__((__aligned__(x))) /* i386 protocol version */ -#pragma pack(push, 4) struct blkif_x86_32_request { uint8_t operation; /* BLKIF_OP_??? */ uint8_t nr_segments; /* number of segments */ @@ -25,15 +26,14 @@ struct blkif_x86_32_request { uint64_t id; /* private guest value, echoed in resp */ blkif_sector_t sector_number;/* start sector idx on disk (r/w only) */ struct blkif_request_segment seg[BLKIF_MAX_SEGMENTS_PER_REQUEST]; -}; +} __aligned(4); struct blkif_x86_32_response { uint64_t id; /* copied from request */ uint8_t operation; /* copied from request */ int16_t status; /* BLKIF_RSP_??? */ -}; +} __aligned(4); typedef struct blkif_x86_32_request blkif_x86_32_request_t; typedef struct blkif_x86_32_response blkif_x86_32_response_t; -#pragma pack(pop) /* x86_64 protocol version */ struct blkif_x86_64_request {