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(