From 74392eccae4293498e4212846795f6bc9aadf6d1 Mon Sep 17 00:00:00 2001 From: Philipp Schuster Date: Thu, 14 May 2026 11:04:10 +0200 Subject: [PATCH] vmm: store PCI segments as a slice The PCI segment list is created once from the configured count. Later code mutates entries, but does not add or remove segments. On-behalf-of: SAP philipp.schuster@sap.com Signed-off-by: Philipp Schuster --- vmm/src/device_manager.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vmm/src/device_manager.rs b/vmm/src/device_manager.rs index c263175ad..06adcf8cf 100644 --- a/vmm/src/device_manager.rs +++ b/vmm/src/device_manager.rs @@ -1046,7 +1046,7 @@ pub struct DeviceManager { // Counter to keep track of the consumed device IDs. device_id_cnt: Wrapping, - pci_segments: Vec, + pci_segments: Box<[PciSegment]>, #[cfg_attr(target_arch = "aarch64", allow(dead_code))] // MSI Interrupt Manager @@ -1402,7 +1402,7 @@ impl DeviceManager { iommu_device: None, iommu_mapping: None, iommu_attached_devices: None, - pci_segments, + pci_segments: pci_segments.into_boxed_slice(), device_tree, exit_evt, reset_evt, @@ -4526,7 +4526,7 @@ impl DeviceManager { .map(|ic| ic.clone() as Arc>) } - pub(crate) fn pci_segments(&self) -> &Vec { + pub(crate) fn pci_segments(&self) -> &[PciSegment] { &self.pci_segments }