mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
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:
committed by
Rob Bradford
parent
afd155d578
commit
34f08002e1
@@ -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)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user