MCPcopy Create free account
hub / github.com/cloud-hypervisor/cloud-hypervisor / add_passthrough_device

Method add_passthrough_device

vmm/src/device_manager.rs:3759–3775  ·  view source on GitHub ↗
(
        &mut self,
        device_cfg: &mut DeviceConfig,
    )

Source from the content-addressed store, hash-verified

3757 }
3758
3759 fn add_passthrough_device(
3760 &mut self,
3761 device_cfg: &mut DeviceConfig,
3762 ) -> DeviceManagerResult<(PciBdf, String)> {
3763 // If the passthrough device has not been created yet, it is created
3764 // here and stored in the DeviceManager structure for future needs.
3765 if self.passthrough_device.is_none() {
3766 self.passthrough_device = Some(
3767 self.address_manager
3768 .vm
3769 .create_passthrough_device()
3770 .map_err(|e| DeviceManagerError::CreatePassthroughDevice(e.into()))?,
3771 );
3772 }
3773
3774 self.add_vfio_device(device_cfg)
3775 }
3776
3777 fn create_vfio_ops(&self) -> DeviceManagerResult<Arc<dyn VfioOps>> {
3778 let passthrough_device = self

Callers 2

add_vfio_devicesMethod · 0.80
add_deviceMethod · 0.80

Calls 2

add_vfio_deviceMethod · 0.80

Tested by

no test coverage detected