Skip to content

Commit a0738f2

Browse files
cr: repr(C) on structures to ensure they have a known serialized layout
1 parent 9e0d5b5 commit a0738f2

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

vm/devices/tdisp/src/serialize.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ use crate::TdispGuestOperationErrorCode;
1919
use crate::TdispTdiState;
2020

2121
/// Serialized form of the header for a GuestToHostCommand packet
22+
#[repr(C)]
2223
#[derive(Debug, Clone, Copy, FromBytes, IntoBytes, KnownLayout, Immutable)]
2324
pub struct GuestToHostCommandSerializedHeader {
2425
/// The logical TDISP device ID of the device that the command is being sent to.
@@ -29,6 +30,7 @@ pub struct GuestToHostCommandSerializedHeader {
2930
}
3031

3132
/// Serialized form of the header for a GuestToHostResponse packet
33+
#[repr(C)]
3234
#[derive(Debug, Clone, Copy, FromBytes, IntoBytes, KnownLayout, Immutable)]
3335
pub struct GuestToHostResponseSerializedHeader {
3436
/// The command ID of the command that was processed. See: `TdispCommandId`

0 commit comments

Comments
 (0)