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

Method add_device

pci/src/bus.rs:172–175  ·  view source on GitHub ↗
(&mut self, device_id: u8, device: Arc<Mutex<dyn PciDevice>>)

Source from the content-addressed store, hash-verified

170 }
171
172 pub fn add_device(&mut self, device_id: u8, device: Arc<Mutex<dyn PciDevice>>) -> Result<()> {
173 self.devices.insert(device_id, device);
174 Ok(())
175 }
176
177 pub fn remove_by_device(&mut self, device: &Arc<Mutex<dyn PciDevice>>) -> Result<()> {
178 self.devices.retain(|_, dev| !Arc::ptr_eq(dev, device));

Callers

nothing calls this directly

Calls 1

insertMethod · 0.45

Tested by

no test coverage detected