⚠️ VeridianOS Kernel Documentation - This is low-level kernel code. All functions are unsafe unless explicitly marked otherwise. no_std

VfioDevice

Struct VfioDevice 

Source
pub struct VfioDevice {
    pub group_id: u32,
    pub pci_address: PciAddress,
    pub bar_regions: Vec<BarRegion>,
    pub irqs: Vec<VfioIrqInfo>,
    pub opened: bool,
    pub vendor_id: u16,
    pub device_id: u16,
    pub assigned_vm: Option<u32>,
}
Expand description

A VFIO-managed PCI device for passthrough

Fields§

§group_id: u32

IOMMU group this device belongs to

§pci_address: PciAddress

PCI address

§bar_regions: Vec<BarRegion>

BAR regions

§irqs: Vec<VfioIrqInfo>

IRQ information

§opened: bool

Whether the device is open (bound to VFIO)

§vendor_id: u16

PCI vendor ID

§device_id: u16

PCI device ID

§assigned_vm: Option<u32>

Assigned VM (if any)

Implementations§

Source§

impl VfioDevice

Source

pub fn open( group_id: u32, pci_address: PciAddress, vendor_id: u16, device_id: u16, ) -> Result<Self, VmError>

Open (bind) a device to VFIO

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§

§

impl<T> Any for T
where T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for T
where T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for T
where T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, U> Into<U> for T
where U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.