(&mut self, mut pmem_cfg: PmemConfig)
| 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 |
no test coverage detected