vmm: Be consistent with PCI bus reservation nomenclature

Our bus slots are now Reserved/Allocated/Free so change the method to
free it to free_device_id() and update error.

Also update to take u8 to match the other methods.

Signed-off-by: Rob Bradford <rbradford@meta.com>
This commit is contained in:
Rob Bradford
2026-04-16 21:01:25 +01:00
parent 18873d88d7
commit d449983495
2 changed files with 16 additions and 9 deletions

View File

@@ -500,9 +500,9 @@ pub enum DeviceManagerError {
#[error("Could not reserve the PCI device ID")]
ReservePciDeviceId(#[source] pci::PciRootError),
/// Could not give the PCI device ID back.
#[error("Could not give the PCI device ID back")]
PutPciDeviceId(#[source] pci::PciRootError),
/// Could not free the PCI device ID.
#[error("Could not free PCI device ID")]
FreePciDeviceId(#[source] pci::PciRootError),
/// No disk path was specified when one was expected
#[error("No disk path was specified when one was expected")]
@@ -4892,8 +4892,8 @@ impl DeviceManager {
.pci_bus
.lock()
.unwrap()
.put_device_id(device_id as usize)
.map_err(DeviceManagerError::PutPciDeviceId)?;
.free_device_id(device_id)
.map_err(DeviceManagerError::FreePciDeviceId)?;
let (pci_device_handle, id) = {
// Remove the device from the device tree along with its children.