Struct pci_driver::backends::vfio::VfioPciDevice
source · [−]pub struct VfioPciDevice { /* private fields */ }Expand description
Provides control over a PCI device using VFIO.
Implementations
sourceimpl VfioPciDevice
impl VfioPciDevice
sourcepub fn open<P: AsRef<Path>>(sysfs_path: P) -> Result<VfioPciDevice>
pub fn open<P: AsRef<Path>>(sysfs_path: P) -> Result<VfioPciDevice>
Creates a new VfioContainer containing only the group that contains the given vfio-pci
device, then calls VfioPciDevice::open_in_container with the same path and the created
container.
Note that this only works if no other VfioContainer already contains the device’s group,
and so you must use VfioPciDevice::open_in_container if you want to drive several
devices from the same VFIO group.
sourcepub fn open_in_container<P: AsRef<Path>>(
sysfs_path: P,
container: Arc<VfioContainer>
) -> Result<VfioPciDevice>
pub fn open_in_container<P: AsRef<Path>>(
sysfs_path: P,
container: Arc<VfioContainer>
) -> Result<VfioPciDevice>
Opens a vfio-pci device and adds it to the given container.
sysfs_path must correspond to the device’s sysfs directory, e.g.,
/sys/bus/pci/devices/0000:00:01.0. container must contain the group to which the device
belongs.
Returns a VfioPciDevice corresponding to the opened device.
sourcepub fn container(&self) -> &Arc<VfioContainer>
pub fn container(&self) -> &Arc<VfioContainer>
Returns a reference to the container to which the device’s group belongs.
Trait Implementations
sourceimpl Debug for VfioPciDevice
impl Debug for VfioPciDevice
sourceimpl PciDevice for VfioPciDevice
impl PciDevice for VfioPciDevice
sourcefn config(&self) -> PciConfig<'_>
fn config(&self) -> PciConfig<'_>
Returns a thing that lets you access the PCI configuration space. Read more
sourcefn bar(&self, index: usize) -> Option<OwningPciRegion>
fn bar(&self, index: usize) -> Option<OwningPciRegion>
Returns a region that corresponds to the Base Address Register (BAR) with the given index,
or None if there is no such BAR or it is unused by the device. Read more
sourcefn rom(&self) -> Option<OwningPciRegion>
fn rom(&self) -> Option<OwningPciRegion>
Returns a region that is the PCI Expansion ROM, or None if the device doesn’t have one. Read more
sourcefn iommu(&self) -> PciIommu<'_>
fn iommu(&self) -> PciIommu<'_>
Returns a thing that lets you manage IOMMU mappings for DMA. Read more
sourcefn interrupts(&self) -> PciInterrupts<'_>
fn interrupts(&self) -> PciInterrupts<'_>
Returns a thing that lets you manage interrupts. Read more
Auto Trait Implementations
impl RefUnwindSafe for VfioPciDevice
impl Send for VfioPciDevice
impl Sync for VfioPciDevice
impl Unpin for VfioPciDevice
impl UnwindSafe for VfioPciDevice
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more