Struct virtio_queue::QueueState[][src]

pub struct QueueState {
    pub max_size: u16,
    pub next_avail: Wrapping<u16>,
    pub next_used: Wrapping<u16>,
    pub event_idx_enabled: bool,
    pub signalled_used: Option<Wrapping<u16>>,
    pub size: u16,
    pub ready: bool,
    pub desc_table: GuestAddress,
    pub avail_ring: GuestAddress,
    pub used_ring: GuestAddress,
}
Expand description

Struct to maintain information and manipulate state of a virtio queue.

Fields

max_size: u16

The maximum size in elements offered by the device.

next_avail: Wrapping<u16>

Tail position of the available ring.

next_used: Wrapping<u16>

Head position of the used ring.

event_idx_enabled: bool

VIRTIO_F_RING_EVENT_IDX negotiated.

signalled_used: Option<Wrapping<u16>>

The last used value when using VIRTIO_F_EVENT_IDX.

size: u16

The queue size in elements the driver selected.

ready: bool

Indicates if the queue is finished with configuration.

desc_table: GuestAddress

Guest physical address of the descriptor table.

avail_ring: GuestAddress

Guest physical address of the available ring.

used_ring: GuestAddress

Guest physical address of the used ring.

Implementations

Get a consuming iterator over all available descriptor chain heads offered by the driver.

Arguments
  • mem - the GuestMemory object that can be used to access the queue buffers.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Type for guard returned by Self::lock().

Construct an empty virtio queue state object with the given max_size.

Check whether the queue configuration is valid.

Reset the queue to the initial state.

Get an exclusive reference to the underlying QueueState object. Read more

Get the maximum size of the virtio queue.

Configure the queue size for the virtio queue.

Check whether the queue is ready to be processed.

Configure the queue to ready for processing state.

Set the descriptor table address for the queue. Read more

Set the available ring address for the queue. Read more

Set the used ring address for the queue. Read more

Enable/disable the VIRTIO_F_RING_EVENT_IDX feature for interrupt coalescing.

Read the idx field from the available ring.

Put a used descriptor head into the used ring.

Enable notification events from the guest driver. Read more

Disable notification events from the guest driver.

Check whether a notification to the guest is needed. Read more

Return the index of the next entry in the available ring.

Set the index of the next entry in the available ring.

Get an exclusive reference to the underlying QueueState object with an associated GuestMemory object. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

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

🔬 This is a nightly-only experimental API. (toowned_clone_into)

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

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.