[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC PATCH-for-9.0 v2 09/19] hw/block/xen_blkif: Align structs with QEMU
From: |
Philippe Mathieu-Daudé |
Subject: |
[RFC PATCH-for-9.0 v2 09/19] hw/block/xen_blkif: Align structs with QEMU_ALIGNED() instead of #pragma |
Date: |
Tue, 14 Nov 2023 15:38:05 +0100 |
Except imported source files, QEMU code base uses
the QEMU_ALIGNED() macro to align its structures.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
hw/block/xen_blkif.h | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/hw/block/xen_blkif.h b/hw/block/xen_blkif.h
index 99733529c1..c1d154d502 100644
--- a/hw/block/xen_blkif.h
+++ b/hw/block/xen_blkif.h
@@ -18,7 +18,6 @@ struct blkif_common_response {
};
/* i386 protocol version */
-#pragma pack(push, 4)
struct blkif_x86_32_request {
uint8_t operation; /* BLKIF_OP_??? */
uint8_t nr_segments; /* number of segments */
@@ -26,7 +25,7 @@ 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];
-};
+} QEMU_ALIGNED(4);
struct blkif_x86_32_request_discard {
uint8_t operation; /* BLKIF_OP_DISCARD */
uint8_t flag; /* nr_segments in request struct */
@@ -34,15 +33,14 @@ struct blkif_x86_32_request_discard {
uint64_t id; /* private guest value, echoed in resp */
blkif_sector_t sector_number; /* start sector idx on disk (r/w only) */
uint64_t nr_sectors; /* # of contiguous sectors to discard */
-};
+} QEMU_ALIGNED(4);
struct blkif_x86_32_response {
uint64_t id; /* copied from request */
uint8_t operation; /* copied from request */
int16_t status; /* BLKIF_RSP_??? */
-};
+} QEMU_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 {
--
2.41.0
- [PATCH-for-9.0 v2 05/19] hw/display: Restrict xen_register_framebuffer() call to Xen, (continued)
[PATCH-for-9.0 v2 07/19] hw/xen: Remove unnecessary xen_hvm_inject_msi() stub, Philippe Mathieu-Daudé, 2023/11/14
[PATCH-for-9.0 v2 08/19] hw/xen: Remove unused Xen stubs, Philippe Mathieu-Daudé, 2023/11/14
[RFC PATCH-for-9.0 v2 09/19] hw/block/xen_blkif: Align structs with QEMU_ALIGNED() instead of #pragma,
Philippe Mathieu-Daudé <=
[PATCH-for-9.0 v2 10/19] hw/xen: Rename 'ram_memory' global variable as 'xen_memory', Philippe Mathieu-Daudé, 2023/11/14
[PATCH-for-9.0 v2 11/19] hw/xen/xen_arch_hvm: Rename prototypes using 'xen_arch_' prefix, Philippe Mathieu-Daudé, 2023/11/14
[PATCH-for-9.0 v2 15/19] hw/xen: Reduce inclusion of 'cpu.h' to target-specific sources, Philippe Mathieu-Daudé, 2023/11/14
[PATCH-for-9.0 v2 12/19] hw/xen: Merge 'hw/xen/arch_hvm.h' in 'hw/xen/xen-hvm-common.h', Philippe Mathieu-Daudé, 2023/11/14
[RFC PATCH-for-9.0 v2 13/19] hw/xen: Remove use of 'target_ulong' in handle_ioreq(), Philippe Mathieu-Daudé, 2023/11/14
[PATCH-for-9.0 v2 14/19] hw/xen: Use target-agnostic qemu_target_page_bits(), Philippe Mathieu-Daudé, 2023/11/14
[PATCH-for-9.0 v2 16/19] hw/xen/xen_pt: Add missing license, Philippe Mathieu-Daudé, 2023/11/14