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

Method free_device_id

pci/src/bus.rs:253–260  ·  view source on GitHub ↗

Frees a PCI device ID on the bus. - `id`: ID to free on the bus. ## Errors Returns [`PciRootError::InvalidPciDeviceSlot`] if the slot exceeds [`NUM_DEVICE_IDS`].

(&mut self, id: u8)

Source from the content-addressed store, hash-verified

251 /// * Returns [`PciRootError::InvalidPciDeviceSlot`] if the slot
252 /// exceeds [`NUM_DEVICE_IDS`].
253 pub fn free_device_id(&mut self, id: u8) -> Result<()> {
254 if id < NUM_DEVICE_IDS {
255 self.device_ids[id as usize] = DeviceIdState::Free;
256 Ok(())
257 } else {
258 Err(PciRootError::InvalidPciDeviceSlot(id as usize))
259 }
260 }
261}
262
263pub struct PciConfigIo {

Callers 1

eject_deviceMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected