Module message

Source
Expand description

Define communication messages for the vhost-user protocol.

For message definition, please refer to the vhost-user spec.

Structs§

DescStatePacked
Inflight I/O descriptor state for packed virtqueues
DescStateSplit
Inflight I/O descriptor state for split virtqueues
DeviceStateTransferParameters
VHOST_USER_SET_DEVICE_STATE_FD request payload.
QueueRegionPacked
Inflight I/O queue region for packed virtqueues
QueueRegionSplit
Inflight I/O queue region for split virtqueues
VhostSharedMemoryRegion
Virtio shared memory descriptor.
VhostUserConfig
Message to read/write device configuration space.
VhostUserConfigFlags
Flags for the device configuration message.
VhostUserEmptyMessage
A generic message for empty message. ZST in repr(C) has same type layout as repr(rust)
VhostUserEmptyMsg
An empty message.
VhostUserExternalMapMsg
Backend request message to map external memory into a shared memory region.
VhostUserGpuMapMsg
Backend request message to map GPU memory into a shared memory region.
VhostUserHeaderFlag
Common message flags for vhost-user requests and replies.
VhostUserInflight
Single memory region descriptor as payload for ADD_MEM_REG and REM_MEM_REG requests. This struct is defined by qemu and compiles with arch-dependent padding. Interestingly, all our supported archs (arm, aarch64, x86_64) has same data layout for this type.
VhostUserMemory
Memory region descriptor for the SET_MEM_TABLE request.
VhostUserMemoryRegion
Memory region descriptors as payload for the SET_MEM_TABLE request.
VhostUserMsgHeader
Common message header for vhost-user requests and replies. A vhost-user message consists of 3 header fields and an optional payload. All numbers are in the machine native byte order.
VhostUserProtocolFeatures
Vhost-user protocol feature flags.
VhostUserShmemMapMsg
Backend request message to map a file into a shared memory region.
VhostUserShmemMapMsgFlags
Flags for SHMEM_MAP messages.
VhostUserShmemUnmapMsg
Backend request message to unmap part of a shared memory region.
VhostUserSingleMemoryRegion
Single memory region descriptor as payload for ADD_MEM_REG and REM_MEM_REG requests.
VhostUserU64
A generic message to encapsulate a 64-bit value.
VhostUserVringAddr
Vring address descriptor.
VhostUserVringAddrFlags
Flags for vring address.
VhostUserVringState
Vring state descriptor.

Enums§

BackendReq
Type of requests sending from backends to frontends.
FrontendReq
Type of requests sent to the backend.
ReqError
Error when converting an integer to an enum value.
VhostUserMigrationPhase
VhostUserTransferDirection

Constants§

MAX_ATTACHED_FD_ENTRIES
The VhostUserMemory message has variable message size and variable number of attached file descriptors. Each user memory region entry in the message payload occupies 32 bytes, so setting maximum number of attached file descriptors based on the maximum message size. But rust only implements Default and AsMut traits for arrays with 0 - 32 entries, so further reduce the maximum number…
VHOST_USER_CONFIG_OFFSET
Starting position (inclusion) of the device configuration space in virtio devices.
VHOST_USER_CONFIG_SIZE
Ending position (exclusion) of the device configuration space in virtio devices.
VHOST_USER_F_PROTOCOL_FEATURES
Virtio feature flag for the vhost-user protocol features.
VHOST_USER_MAX_VRINGS
Maximum number of vrings supported.
VIRTIO_F_RING_PACKED

Traits§

Req
Message type. Either [FrontendReq] or [BackendReq].
VhostUserMsgValidator
Vhost message Validator.

Type Aliases§

VhostUserConfigPayload
Payload for the VhostUserConfig message.
VhostUserMemoryPayload
Payload of the VhostUserMemory message.