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

Method add_vdpa

vmm/src/vm.rs:2399–2421  ·  view source on GitHub ↗
(&mut self, mut vdpa_cfg: VdpaConfig)

Source from the content-addressed store, hash-verified

2397 }
2398
2399 pub fn add_vdpa(&mut self, mut vdpa_cfg: VdpaConfig) -> Result<PciDeviceInfo> {
2400 let pci_device_info = self
2401 .device_manager
2402 .lock()
2403 .unwrap()
2404 .add_vdpa(&mut vdpa_cfg)
2405 .map_err(Error::DeviceManager)?;
2406
2407 // Update VmConfig by adding the new device. This is important to
2408 // ensure the device would be created in case of a reboot.
2409 {
2410 let mut config = self.config.lock().unwrap();
2411 add_to_config(&mut config.vdpa, vdpa_cfg);
2412 }
2413
2414 self.device_manager
2415 .lock()
2416 .unwrap()
2417 .notify_hotplug(AcpiNotificationFlags::PCI_DEVICES_CHANGED)
2418 .map_err(Error::DeviceManager)?;
2419
2420 Ok(pci_device_info)
2421 }
2422
2423 pub fn add_vsock(&mut self, mut vsock_cfg: VsockConfig) -> Result<PciDeviceInfo> {
2424 let pci_device_info = self

Callers 1

vm_add_vdpaMethod · 0.45

Calls 2

add_to_configFunction · 0.85
notify_hotplugMethod · 0.80

Tested by

no test coverage detected