(&mut self, id: &str)
| 2255 | } |
| 2256 | |
| 2257 | pub fn remove_device(&mut self, id: &str) -> Result<()> { |
| 2258 | self.device_manager |
| 2259 | .lock() |
| 2260 | .unwrap() |
| 2261 | .remove_device(id) |
| 2262 | .map_err(Error::DeviceManager)?; |
| 2263 | |
| 2264 | // Update VmConfig by removing the device. This is important to |
| 2265 | // ensure the device would not be created in case of a reboot. |
| 2266 | self.config.lock().unwrap().remove_device(id); |
| 2267 | |
| 2268 | self.device_manager |
| 2269 | .lock() |
| 2270 | .unwrap() |
| 2271 | .notify_hotplug(AcpiNotificationFlags::PCI_DEVICES_CHANGED) |
| 2272 | .map_err(Error::DeviceManager)?; |
| 2273 | Ok(()) |
| 2274 | } |
| 2275 | |
| 2276 | pub fn add_disk(&mut self, mut disk_cfg: DiskConfig) -> Result<PciDeviceInfo> { |
| 2277 | let pci_device_info = self |
no test coverage detected