pub struct VfioDevice { /* private fields */ }
Expand description
A device backend accessed via VFIO.
Implementations§
Source§impl VfioDevice
impl VfioDevice
Sourcepub async fn new(
driver_source: &VmTaskDriverSource,
pci_id: &str,
dma_client: Arc<dyn DmaClient>,
) -> Result<Self>
pub async fn new( driver_source: &VmTaskDriverSource, pci_id: &str, dma_client: Arc<dyn DmaClient>, ) -> Result<Self>
Creates a new VFIO-backed device for the PCI device with pci_id
.
Sourcepub async fn restore(
driver_source: &VmTaskDriverSource,
pci_id: &str,
keepalive: bool,
dma_client: Arc<dyn DmaClient>,
) -> Result<Self>
pub async fn restore( driver_source: &VmTaskDriverSource, pci_id: &str, keepalive: bool, dma_client: Arc<dyn DmaClient>, ) -> Result<Self>
Creates a new VFIO-backed device for the PCI device with pci_id
.
or creates a device from the saved state if provided.
pub fn read_config(&self, offset: u16) -> Result<u32>
pub fn write_config(&self, offset: u16, data: u32) -> Result<()>
Trait Implementations§
Source§impl DeviceBacking for VfioDevice
impl DeviceBacking for VfioDevice
Source§type Registers = MappedRegionWithFallback
type Registers = MappedRegionWithFallback
An object for accessing device registers.
Source§fn dma_client(&self) -> Arc<dyn DmaClient>
fn dma_client(&self) -> Arc<dyn DmaClient>
DMA Client for the device.
Source§fn max_interrupt_count(&self) -> u32
fn max_interrupt_count(&self) -> u32
Returns the maximum number of interrupts that can be mapped.
Source§fn map_interrupt(&mut self, msix: u32, cpu: u32) -> Result<DeviceInterrupt>
fn map_interrupt(&mut self, msix: u32, cpu: u32) -> Result<DeviceInterrupt>
Maps a MSI-X interrupt for use, returning an object that can be used to
wait for the interrupt to be signaled by the device. Read more
Auto Trait Implementations§
impl Freeze for VfioDevice
impl !RefUnwindSafe for VfioDevice
impl Send for VfioDevice
impl Sync for VfioDevice
impl Unpin for VfioDevice
impl !UnwindSafe for VfioDevice
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more