From 622f3f8fb6e400f69ca1d597790d18a9db0cbdbe Mon Sep 17 00:00:00 2001 From: Samuel Ortiz Date: Mon, 16 Mar 2020 16:23:42 +0100 Subject: [PATCH] vmm: vm: Avoid ioapic variable creation For a more readable VM creation routine. Signed-off-by: Samuel Ortiz --- vmm/src/vm.rs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/vmm/src/vm.rs b/vmm/src/vm.rs index 1fa244777..b2e6277ec 100755 --- a/vmm/src/vm.rs +++ b/vmm/src/vm.rs @@ -317,11 +317,6 @@ impl Vm { .transpose() .map_err(Error::InitramfsFile)?; - let ioapic = GsiApic::new( - X86_64_IRQ_BASE, - ioapic::NUM_IOAPIC_PINS as u32 - X86_64_IRQ_BASE, - ); - // Let's allocate 64 GiB of addressable MMIO space, starting at 0. let allocator = Arc::new(Mutex::new( SystemAllocator::new( @@ -331,7 +326,10 @@ impl Vm { 1 << get_host_cpu_phys_bits(), layout::MEM_32BIT_RESERVED_START, layout::MEM_32BIT_DEVICES_SIZE, - vec![ioapic], + vec![GsiApic::new( + X86_64_IRQ_BASE, + ioapic::NUM_IOAPIC_PINS as u32 - X86_64_IRQ_BASE, + )], ) .ok_or(Error::CreateSystemAllocator)?, ));