MCPcopy Create free account
hub / github.com/cloud-hypervisor/cloud-hypervisor / remove_device

Method remove_device

vmm/src/vm.rs:2257–2274  ·  view source on GitHub ↗
(&mut self, id: &str)

Source from the content-addressed store, hash-verified

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

Callers 1

vm_remove_deviceMethod · 0.45

Calls 1

notify_hotplugMethod · 0.80

Tested by

no test coverage detected