#[repr(C)]pub struct VirtQueueDesc {
pub base_addr: GuestPhysAddr,
pub len: u32,
pub flags: u16,
pub next: u16,
}Expand description
VirtIO queue descriptor structure.
This structure represents the memory layout of a single descriptor in the descriptor table according to the VirtIO specification. It is a C-compatible data structure that directly maps to guest memory.
Each descriptor describes a buffer in guest memory that can be used for device I/O operations. Descriptors can be chained together using the NEXT flag to describe scatter-gather buffers.
This structure is used by DescriptorTable to read/write individual
descriptors in guest memory through the guest memory accessor.
Fields§
§base_addr: GuestPhysAddrAddress (guest-physical)
len: u32Length
flags: u16Flags
next: u16Next descriptor index (if VIRTQ_DESC_F_NEXT is set)
Implementations§
Source§impl VirtQueueDesc
impl VirtQueueDesc
Sourcepub fn new(base_addr: GuestPhysAddr, len: u32, flags: u16, next: u16) -> Self
pub fn new(base_addr: GuestPhysAddr, len: u32, flags: u16, next: u16) -> Self
Create a new descriptor
Sourcepub fn is_indirect(&self) -> bool
pub fn is_indirect(&self) -> bool
Check if this descriptor is indirect
Sourcepub fn guest_addr(&self) -> GuestPhysAddr
pub fn guest_addr(&self) -> GuestPhysAddr
Get the guest physical address
Sourcepub fn set_write_only(&mut self, is_write: bool)
pub fn set_write_only(&mut self, is_write: bool)
Set the write flag (alias for compatibility)
Sourcepub fn is_write_only(&self) -> bool
pub fn is_write_only(&self) -> bool
Check if this descriptor is write-only (alias for compatibility)
Sourcepub fn set_indirect(&mut self, is_indirect: bool)
pub fn set_indirect(&mut self, is_indirect: bool)
Set the indirect flag
Trait Implementations§
Source§impl Clone for VirtQueueDesc
impl Clone for VirtQueueDesc
Source§fn clone(&self) -> VirtQueueDesc
fn clone(&self) -> VirtQueueDesc
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more