vmm, devices: Use APIC address constant

In order to avoid introducing a dependency on arch in the devices crate
pass the constant in to the IOAPIC device creation.

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
Rob Bradford
2019-09-27 17:51:46 +01:00
committed by Sebastien Boeuf
parent 162791b571
commit b5ee9212c1
2 changed files with 10 additions and 4 deletions

View File

@@ -28,7 +28,7 @@ use qcow::{self, ImageType, QcowFile};
use std::fs::{File, OpenOptions};
use std::io::{self, sink, stdout};
use arch::layout::{IOAPIC_SIZE, IOAPIC_START};
use arch::layout::{APIC_START, IOAPIC_SIZE, IOAPIC_START};
use std::os::unix::fs::OpenOptionsExt;
use std::os::unix::io::AsRawFd;
use std::ptr::null_mut;
@@ -305,7 +305,10 @@ impl DeviceManager {
let ioapic = if userspace_ioapic {
// Create IOAPIC
let ioapic = Arc::new(Mutex::new(ioapic::Ioapic::new(vm_info.vm_fd.clone())));
let ioapic = Arc::new(Mutex::new(ioapic::Ioapic::new(
vm_info.vm_fd.clone(),
APIC_START,
)));
buses
.mmio
.insert(ioapic.clone(), IOAPIC_START.0, IOAPIC_SIZE)