mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
vmm: Move CpuManager and Vcpu to the new restore design
Every Vcpu is now created with the right state if there's an available snapshot associated with it. This simplifies the restore logic. Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
This commit is contained in:
@@ -541,7 +541,7 @@ impl Vm {
|
||||
cpu_manager
|
||||
.lock()
|
||||
.unwrap()
|
||||
.create_boot_vcpus()
|
||||
.create_boot_vcpus(snapshot_from_id(snapshot, CPU_MANAGER_SNAPSHOT_ID))
|
||||
.map_err(Error::CpuManager)?;
|
||||
|
||||
#[cfg(feature = "tdx")]
|
||||
@@ -2083,7 +2083,7 @@ impl Vm {
|
||||
self.cpu_manager
|
||||
.lock()
|
||||
.unwrap()
|
||||
.configure_vcpu(vcpu, entry_point, None)
|
||||
.configure_vcpu(vcpu, entry_point)
|
||||
.map_err(Error::CpuManager)?;
|
||||
}
|
||||
|
||||
@@ -2636,17 +2636,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"
|
||||
)));
|
||||
}
|
||||
|
||||
#[cfg(target_arch = "aarch64")]
|
||||
self.restore_vgic_and_enable_interrupt(&snapshot)?;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user