vmm: Add ioapic to KvmInterruptManager

By having a reference to the IOAPIC, the KvmInterruptManager is going
to be able to initialize properly the legacy interrupt source group.

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
This commit is contained in:
Sebastien Boeuf 2020-01-20 11:15:12 +01:00 committed by Samuel Ortiz
parent c9ea235a0e
commit f70c9937fb
2 changed files with 5 additions and 0 deletions

View File

@ -458,6 +458,7 @@ impl DeviceManager {
address_manager.allocator.clone(),
vm_info.vm_fd.clone(),
kvm_gsi_msi_routes,
ioapic.clone(),
));
let console = DeviceManager::add_console_device(

View File

@ -3,6 +3,7 @@
// SPDX-License-Identifier: Apache-2.0 AND BSD-3-Clause
//
use devices::ioapic;
use kvm_bindings::{kvm_irq_routing, kvm_irq_routing_entry, KVM_IRQ_ROUTING_MSI};
use kvm_ioctls::VmFd;
use std::collections::HashMap;
@ -263,6 +264,7 @@ pub struct KvmInterruptManager {
allocator: Arc<Mutex<SystemAllocator>>,
vm_fd: Arc<VmFd>,
gsi_msi_routes: Arc<Mutex<HashMap<u32, KvmRoutingEntry>>>,
_ioapic: Arc<Mutex<ioapic::Ioapic>>,
}
impl KvmInterruptManager {
@ -270,11 +272,13 @@ impl KvmInterruptManager {
allocator: Arc<Mutex<SystemAllocator>>,
vm_fd: Arc<VmFd>,
gsi_msi_routes: Arc<Mutex<HashMap<u32, KvmRoutingEntry>>>,
ioapic: Arc<Mutex<ioapic::Ioapic>>,
) -> Self {
KvmInterruptManager {
allocator,
vm_fd,
gsi_msi_routes,
_ioapic: ioapic,
}
}
}