(
&mut self,
mut generic_vhost_user_cfg: GenericVhostUserConfig,
)
| 2322 | } |
| 2323 | |
| 2324 | pub fn add_generic_vhost_user( |
| 2325 | &mut self, |
| 2326 | mut generic_vhost_user_cfg: GenericVhostUserConfig, |
| 2327 | ) -> Result<PciDeviceInfo> { |
| 2328 | let pci_device_info = self |
| 2329 | .device_manager |
| 2330 | .lock() |
| 2331 | .unwrap() |
| 2332 | .add_generic_vhost_user(&mut generic_vhost_user_cfg) |
| 2333 | .map_err(Error::DeviceManager)?; |
| 2334 | |
| 2335 | // Update VmConfig by adding the new device. This is important to |
| 2336 | // ensure the device would be created in case of a reboot. |
| 2337 | { |
| 2338 | let mut config = self.config.lock().unwrap(); |
| 2339 | add_to_config(&mut config.generic_vhost_user, generic_vhost_user_cfg); |
| 2340 | } |
| 2341 | |
| 2342 | self.device_manager |
| 2343 | .lock() |
| 2344 | .unwrap() |
| 2345 | .notify_hotplug(AcpiNotificationFlags::PCI_DEVICES_CHANGED) |
| 2346 | .map_err(Error::DeviceManager)?; |
| 2347 | |
| 2348 | Ok(pci_device_info) |
| 2349 | } |
| 2350 | |
| 2351 | pub fn add_pmem(&mut self, mut pmem_cfg: PmemConfig) -> Result<PciDeviceInfo> { |
| 2352 | let pci_device_info = self |
no test coverage detected