(&mut self, mut disk_cfg: DiskConfig)
| 2274 | } |
| 2275 | |
| 2276 | pub fn add_disk(&mut self, mut disk_cfg: DiskConfig) -> Result<PciDeviceInfo> { |
| 2277 | let pci_device_info = self |
| 2278 | .device_manager |
| 2279 | .lock() |
| 2280 | .unwrap() |
| 2281 | .add_disk(&mut disk_cfg) |
| 2282 | .map_err(Error::DeviceManager)?; |
| 2283 | |
| 2284 | // Update VmConfig by adding the new device. This is important to |
| 2285 | // ensure the device would be created in case of a reboot. |
| 2286 | { |
| 2287 | let mut config = self.config.lock().unwrap(); |
| 2288 | add_to_config(&mut config.disks, disk_cfg); |
| 2289 | } |
| 2290 | |
| 2291 | self.device_manager |
| 2292 | .lock() |
| 2293 | .unwrap() |
| 2294 | .notify_hotplug(AcpiNotificationFlags::PCI_DEVICES_CHANGED) |
| 2295 | .map_err(Error::DeviceManager)?; |
| 2296 | |
| 2297 | Ok(pci_device_info) |
| 2298 | } |
| 2299 | |
| 2300 | pub fn add_fs(&mut self, mut fs_cfg: FsConfig) -> Result<PciDeviceInfo> { |
| 2301 | let pci_device_info = self |
no test coverage detected