vmm: Allow for device ID allocation on a segment

Allocating a device ID is crucial for assigning a specific ID to a
device. We need this to implement configurable PCI device ID.

Signed-off-by: Pascal Scholz <pascal.scholz@cyberus-technology.de>
On-behalf-of: SAP pascal.scholz@sap.com
Signed-off-by: Rob Bradford <rbradford@meta.com>
This commit is contained in:
Pascal Scholz
2026-03-26 14:16:06 +01:00
committed by Rob Bradford
parent afd155d578
commit 34f08002e1
3 changed files with 160 additions and 14 deletions
+3 -2
View File
@@ -494,7 +494,7 @@ pub enum DeviceManagerError {
/// Failed to find an available PCI device ID.
#[error("Failed to find an available PCI device ID")]
NextPciDeviceId(#[source] pci::PciRootError),
AllocatePciDeviceId(#[source] pci::PciRootError),
/// Could not reserve the PCI device ID.
#[error("Could not reserve the PCI device ID")]
@@ -4555,7 +4555,8 @@ impl DeviceManager {
(pci_segment_id, pci_device_bdf, resources)
} else {
let pci_device_bdf = self.pci_segments[pci_segment_id as usize].next_device_bdf()?;
let pci_device_bdf =
self.pci_segments[pci_segment_id as usize].allocate_device_id(None)?;
(pci_segment_id, pci_device_bdf, None)
})