Skip to main content

QueueConfig

Struct QueueConfig 

Source
pub struct QueueConfig {
    pub desc_addr: u64,
    pub avail_addr: u64,
    pub used_addr: u64,
    pub size: u16,
    pub ready: bool,
    pub gpa_base: u64,
}
Expand description

Configuration for a single virtqueue, as set by the guest driver via MMIO transport writes.

All addresses are guest physical addresses (GPAs). The memory slice passed to VirtioDevice::process_queue starts at gpa_base, so devices must subtract gpa_base to convert a GPA to a slice index.

Device-specific state (e.g. the vsock host connection manager) is not plumbed through this struct — devices that need such state hold it directly via their own bind_* setters.

Fields§

§desc_addr: u64

Guest physical address of the descriptor table.

§avail_addr: u64

Guest physical address of the available (driver) ring.

§used_addr: u64

Guest physical address of the used (device) ring.

§size: u16

Queue size (number of descriptors).

§ready: bool

Whether the queue is ready.

§gpa_base: u64

GPA of the start of the guest memory slice. Devices must subtract this from descriptor addresses to get slice offsets.

Trait Implementations§

Source§

impl Debug for QueueConfig

Source§

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

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

impl Default for QueueConfig

Source§

fn default() -> QueueConfig

Returns the “default value” for a type. Read more

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, U> TryFrom<U> for T
where U: Into<T>,

Source§

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>,

Source§

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.