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
Trait Implementations
Construct an empty virtio queue state object with the given max_size
.
Check whether the queue configuration is valid.
Get an exclusive reference to the underlying QueueState
object. Read more
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.
fn lock_with_memory<M>(
&mut self,
mem: M
) -> QueueGuard<M, <Self as QueueStateGuard<'_>>::G> where
M: Deref + Clone,
M::Target: GuestMemory + Sized,
fn lock_with_memory<M>(
&mut self,
mem: M
) -> QueueGuard<M, <Self as QueueStateGuard<'_>>::G> where
M: Deref + Clone,
M::Target: GuestMemory + Sized,
Get an exclusive reference to the underlying QueueState
object with an associated
GuestMemory
object. Read more
Auto Trait Implementations
impl RefUnwindSafe for QueueState
impl Send for QueueState
impl Sync for QueueState
impl Unpin for QueueState
impl UnwindSafe for QueueState
Blanket Implementations
Mutably borrows from an owned value. Read more