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

Method add_pmem

vmm/src/vm.rs:2351–2373  ·  view source on GitHub ↗
(&mut self, mut pmem_cfg: PmemConfig)

Source from the content-addressed store, hash-verified

2349 }
2350
2351 pub fn add_pmem(&mut self, mut pmem_cfg: PmemConfig) -> Result<PciDeviceInfo> {
2352 let pci_device_info = self
2353 .device_manager
2354 .lock()
2355 .unwrap()
2356 .add_pmem(&mut pmem_cfg)
2357 .map_err(Error::DeviceManager)?;
2358
2359 // Update VmConfig by adding the new device. This is important to
2360 // ensure the device would be created in case of a reboot.
2361 {
2362 let mut config = self.config.lock().unwrap();
2363 add_to_config(&mut config.pmem, pmem_cfg);
2364 }
2365
2366 self.device_manager
2367 .lock()
2368 .unwrap()
2369 .notify_hotplug(AcpiNotificationFlags::PCI_DEVICES_CHANGED)
2370 .map_err(Error::DeviceManager)?;
2371
2372 Ok(pci_device_info)
2373 }
2374
2375 pub fn add_net(&mut self, mut net_cfg: NetConfig) -> Result<PciDeviceInfo> {
2376 let pci_device_info = self

Callers 1

vm_add_pmemMethod · 0.45

Calls 2

add_to_configFunction · 0.85
notify_hotplugMethod · 0.80

Tested by

no test coverage detected