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