From c2c3178038775cd5e8ce05b8b5a8a89424fd3798 Mon Sep 17 00:00:00 2001 From: Philipp Schuster Date: Thu, 14 May 2026 11:04:02 +0200 Subject: [PATCH] vmm: store PCI MMIO allocators as slices The allocator lists are sized from the fixed PCI segment count. They are only indexed afterwards, so boxed slices fit the use. On-behalf-of: SAP philipp.schuster@sap.com Signed-off-by: Philipp Schuster --- vmm/src/device_manager.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/vmm/src/device_manager.rs b/vmm/src/device_manager.rs index e6902a4cb..c263175ad 100644 --- a/vmm/src/device_manager.rs +++ b/vmm/src/device_manager.rs @@ -711,8 +711,8 @@ pub(crate) struct AddressManager { pub(crate) mmio_bus: Arc, pub(crate) vm: Arc, device_tree: Arc>, - pci_mmio32_allocators: Vec>>, - pci_mmio64_allocators: Vec>>, + pci_mmio32_allocators: Box<[Arc>]>, + pci_mmio64_allocators: Box<[Arc>]>, } impl DeviceRelocation for AddressManager { @@ -1160,7 +1160,7 @@ fn create_mmio_allocators( num_pci_segments: u16, weights: &[u32], alignment: u64, -) -> Vec>> { +) -> Box<[Arc>]> { let total_weight: u32 = weights.iter().sum(); // Start each PCI segment mmio range on an aligned boundary @@ -1187,7 +1187,7 @@ fn create_mmio_allocators( i += weight; } - mmio_allocators + mmio_allocators.into_boxed_slice() } fn use_64bit_bar_for_virtio_device(