#[repr(u32)]
pub enum FrontendReq {
Show 43 variants GET_FEATURES = 1, SET_FEATURES = 2, SET_OWNER = 3, RESET_OWNER = 4, SET_MEM_TABLE = 5, SET_LOG_BASE = 6, SET_LOG_FD = 7, SET_VRING_NUM = 8, SET_VRING_ADDR = 9, SET_VRING_BASE = 10, GET_VRING_BASE = 11, SET_VRING_KICK = 12, SET_VRING_CALL = 13, SET_VRING_ERR = 14, GET_PROTOCOL_FEATURES = 15, SET_PROTOCOL_FEATURES = 16, GET_QUEUE_NUM = 17, SET_VRING_ENABLE = 18, SEND_RARP = 19, NET_SET_MTU = 20, SET_BACKEND_REQ_FD = 21, IOTLB_MSG = 22, SET_VRING_ENDIAN = 23, GET_CONFIG = 24, SET_CONFIG = 25, CREATE_CRYPTO_SESSION = 26, CLOSE_CRYPTO_SESSION = 27, POSTCOPY_ADVISE = 28, POSTCOPY_LISTEN = 29, POSTCOPY_END = 30, GET_INFLIGHT_FD = 31, SET_INFLIGHT_FD = 32, GPU_SET_SOCKET = 33, RESET_DEVICE = 34, VRING_KICK = 35, GET_MAX_MEM_SLOTS = 36, ADD_MEM_REG = 37, REM_MEM_REG = 38, SET_STATUS = 39, GET_STATUS = 40, SET_DEVICE_STATE_FD = 42, CHECK_DEVICE_STATE = 43, GET_SHARED_MEMORY_REGIONS = 1_004,
}
Expand description

Type of requests sent to the backend.

These are called “front-end message types” in the spec, so we call them FrontendReq here even though it is somewhat confusing that the BackendClient sends FrontendReqs to a BackendServer.

Variants§

§

GET_FEATURES = 1

Get from the underlying vhost implementation the features bit mask.

§

SET_FEATURES = 2

Enable features in the underlying vhost implementation using a bit mask.

§

SET_OWNER = 3

Set the current frontend as an owner of the session.

§

RESET_OWNER = 4

No longer used.

§

SET_MEM_TABLE = 5

Set the memory map regions on the backend so it can translate the vring addresses.

§

SET_LOG_BASE = 6

Set logging shared memory space.

§

SET_LOG_FD = 7

Set the logging file descriptor, which is passed as ancillary data.

§

SET_VRING_NUM = 8

Set the size of the queue.

§

SET_VRING_ADDR = 9

Set the addresses of the different aspects of the vring.

§

SET_VRING_BASE = 10

Set the base offset in the available vring.

§

GET_VRING_BASE = 11

Get the available vring base offset.

§

SET_VRING_KICK = 12

Set the event file descriptor for adding buffers to the vring.

§

SET_VRING_CALL = 13

Set the event file descriptor to signal when buffers are used.

§

SET_VRING_ERR = 14

Set the event file descriptor to signal when error occurs.

§

GET_PROTOCOL_FEATURES = 15

Get the protocol feature bit mask from the underlying vhost implementation.

§

SET_PROTOCOL_FEATURES = 16

Enable protocol features in the underlying vhost implementation.

§

GET_QUEUE_NUM = 17

Query how many queues the backend supports.

§

SET_VRING_ENABLE = 18

Signal backend to enable or disable corresponding vring.

§

SEND_RARP = 19

Ask vhost user backend to broadcast a fake RARP to notify the migration is terminated for guest that does not support GUEST_ANNOUNCE.

§

NET_SET_MTU = 20

Set host MTU value exposed to the guest.

§

SET_BACKEND_REQ_FD = 21

Set the socket file descriptor for backend initiated requests.

§

IOTLB_MSG = 22

Send IOTLB messages with struct vhost_iotlb_msg as payload.

§

SET_VRING_ENDIAN = 23

Set the endianness of a VQ for legacy devices.

§

GET_CONFIG = 24

Fetch the contents of the virtio device configuration space.

§

SET_CONFIG = 25

Change the contents of the virtio device configuration space.

§

CREATE_CRYPTO_SESSION = 26

Create a session for crypto operation.

§

CLOSE_CRYPTO_SESSION = 27

Close a session for crypto operation.

§

POSTCOPY_ADVISE = 28

Advise backend that a migration with postcopy enabled is underway.

§

POSTCOPY_LISTEN = 29

Advise backend that a transition to postcopy mode has happened.

§

POSTCOPY_END = 30

Advise that postcopy migration has now completed.

§

GET_INFLIGHT_FD = 31

Get a shared buffer from backend.

§

SET_INFLIGHT_FD = 32

Send the shared inflight buffer back to backend.

§

GPU_SET_SOCKET = 33

Sets the GPU protocol socket file descriptor.

§

RESET_DEVICE = 34

Ask the vhost user backend to disable all rings and reset all internal device state to the initial state.

§

VRING_KICK = 35

Indicate that a buffer was added to the vring instead of signalling it using the vring’s kick file descriptor.

§

GET_MAX_MEM_SLOTS = 36

Return a u64 payload containing the maximum number of memory slots.

§

ADD_MEM_REG = 37

Update the memory tables by adding the region described.

§

REM_MEM_REG = 38

Update the memory tables by removing the region described.

§

SET_STATUS = 39

Notify the backend with updated device status as defined in the VIRTIO specification.

§

GET_STATUS = 40

Query the backend for its device status as defined in the VIRTIO specification.

§

SET_DEVICE_STATE_FD = 42

Front-end and back-end negotiate a channel over which to transfer the back-end’s internal state during migration.

§

CHECK_DEVICE_STATE = 43

After transferring the back-end’s internal state during migration, check whether the back-end was able to successfully fully process the state.

§

GET_SHARED_MEMORY_REGIONS = 1_004

Get a list of the device’s shared memory regions.

Implementations§

source§

impl FrontendReq

source

pub fn n(value: u32) -> Option<Self>

Trait Implementations§

source§

impl Clone for FrontendReq

source§

fn clone(&self) -> FrontendReq

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for FrontendReq

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl From<FrontendReq> for u32

source§

fn from(req: FrontendReq) -> u32

Converts to this type from the input type.
source§

impl Ord for FrontendReq

source§

fn cmp(&self, other: &FrontendReq) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

impl PartialEq for FrontendReq

source§

fn eq(&self, other: &FrontendReq) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for FrontendReq

source§

fn partial_cmp(&self, other: &FrontendReq) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl TryFrom<u32> for FrontendReq

§

type Error = ReqError

The type returned in the event of a conversion error.
source§

fn try_from(value: u32) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl Copy for FrontendReq

source§

impl Eq for FrontendReq

source§

impl Req for FrontendReq

source§

impl StructuralPartialEq for FrontendReq

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.