mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2025-03-20 07:58:55 +00:00
vmm: cpu: Allocate I/O port for the CPU manager
The CPU manager uses an I/O port and to prevent potential clashes with assignment for PCI devices ensure that it is allocated by the allocator. Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
parent
07cdb37dda
commit
348a1bc30e
@ -113,6 +113,9 @@ pub enum Error {
|
||||
|
||||
/// Cannot add legacy device to Bus.
|
||||
BusError(devices::BusError),
|
||||
|
||||
/// Failed to allocate IO port
|
||||
AllocateIOPort,
|
||||
}
|
||||
pub type Result<T> = result::Result<T, Error>;
|
||||
|
||||
@ -405,6 +408,13 @@ impl CpuManager {
|
||||
selected_cpu: 0,
|
||||
}));
|
||||
|
||||
device_manager
|
||||
.allocator()
|
||||
.lock()
|
||||
.unwrap()
|
||||
.allocate_io_addresses(Some(GuestAddress(0x0cd8)), 0x8, None)
|
||||
.ok_or(Error::AllocateIOPort)?;
|
||||
|
||||
cpu_manager
|
||||
.lock()
|
||||
.unwrap()
|
||||
|
Loading…
x
Reference in New Issue
Block a user