mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2024-12-22 13:45:20 +00:00
vmm: Ensure restore matches boot sequence
The vCPU is created and set after all the devices on a VM's boot. There's no reason to follow a different order on the restore codepath as this could cause some unexpected behaviors. Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
This commit is contained in:
parent
9260c3816e
commit
3edaa8adb6
@ -2753,17 +2753,6 @@ impl Snapshottable for Vm {
|
||||
)));
|
||||
}
|
||||
|
||||
if let Some(cpu_manager_snapshot) = snapshot.snapshots.get(CPU_MANAGER_SNAPSHOT_ID) {
|
||||
self.cpu_manager
|
||||
.lock()
|
||||
.unwrap()
|
||||
.restore(*cpu_manager_snapshot.clone())?;
|
||||
} else {
|
||||
return Err(MigratableError::Restore(anyhow!(
|
||||
"Missing CPU manager snapshot"
|
||||
)));
|
||||
}
|
||||
|
||||
if let Some(device_manager_snapshot) = snapshot.snapshots.get(DEVICE_MANAGER_SNAPSHOT_ID) {
|
||||
self.device_manager
|
||||
.lock()
|
||||
@ -2775,6 +2764,17 @@ impl Snapshottable for Vm {
|
||||
)));
|
||||
}
|
||||
|
||||
if let Some(cpu_manager_snapshot) = snapshot.snapshots.get(CPU_MANAGER_SNAPSHOT_ID) {
|
||||
self.cpu_manager
|
||||
.lock()
|
||||
.unwrap()
|
||||
.restore(*cpu_manager_snapshot.clone())?;
|
||||
} else {
|
||||
return Err(MigratableError::Restore(anyhow!(
|
||||
"Missing CPU manager snapshot"
|
||||
)));
|
||||
}
|
||||
|
||||
#[cfg(target_arch = "aarch64")]
|
||||
self.restore_vgic_and_enable_interrupt(&snapshot)?;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user