Skip to main content

build_vpci_device

Function build_vpci_device 

Source
pub async fn build_vpci_device(
    ctx: PciDeviceResolveContext<'_>,
    vmbus: &VmbusServerControl,
    chipset_builder: &ChipsetBuilder<'_>,
    bus_config: VpciBusConfig,
    guest_memory: GuestMemory,
    new_virtual_device: impl FnOnce(u64) -> Result<(Arc<dyn SignalMsi>, VpciInterruptMapper)>,
) -> Result<()>
Expand description

Resolves a PCI device resource, builds the corresponding device, and builds a VPCI bus to host it.

VPCI devices deliver interrupts through the vmbus [VpciInterruptMapper] rather than a PCIe MsiTarget, so this builds a fresh [DmaTarget] pairing guest_memory with a locally-owned [MsiConnection] that is connected to the virtual device’s MSI controller.