mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
vmm: Encase CpuManager within an Arc<Mutex<>>
This is necessary to be able to add the CpuManager onto the IO bus. Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
committed by
Sebastien Boeuf
parent
d7dc1a9226
commit
1ac1231292
@@ -349,8 +349,8 @@ impl CpuManager {
|
||||
fd: Arc<VmFd>,
|
||||
cpuid: CpuId,
|
||||
reset_evt: EventFd,
|
||||
) -> CpuManager {
|
||||
CpuManager {
|
||||
) -> Arc<Mutex<CpuManager>> {
|
||||
let cpu_manager = Arc::new(Mutex::new(CpuManager {
|
||||
boot_vcpus,
|
||||
io_bus: device_manager.io_bus().clone(),
|
||||
mmio_bus: device_manager.mmio_bus().clone(),
|
||||
@@ -362,7 +362,9 @@ impl CpuManager {
|
||||
vcpus_pause_signalled: Arc::new(AtomicBool::new(false)),
|
||||
threads: Vec::with_capacity(boot_vcpus as usize),
|
||||
reset_evt,
|
||||
}
|
||||
}));
|
||||
|
||||
cpu_manager
|
||||
}
|
||||
|
||||
// Starts all the vCPUs that the VM is booting with. Blocks until all vCPUs are running.
|
||||
|
||||
Reference in New Issue
Block a user