mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
vmm: support restore KVM clock in migration
In migration, vm object is created by new_from_migration with NULL kvm clock. so vm.set_clock will not be called during vm resume. If the guest using kvm-clock, the ticks will be stopped after migration. As clock was already saved to snapshot, add a method to restore it before vm resume in migration. after that, guest's kvm-clock works well. Signed-off-by: Ren Lei <ren.lei4@zte.com.cn>
This commit is contained in:
@@ -776,6 +776,10 @@ impl Vmm {
|
||||
MigratableError::MigrateReceive(anyhow!("Error deserialising snapshot: {}", e))
|
||||
})?;
|
||||
|
||||
#[cfg(all(feature = "kvm", target_arch = "x86_64"))]
|
||||
vm.load_clock_from_snapshot(&snapshot)
|
||||
.map_err(|e| MigratableError::MigrateReceive(anyhow!("Error resume clock: {:?}", e)))?;
|
||||
|
||||
// Create VM
|
||||
vm.restore(snapshot).map_err(|e| {
|
||||
Response::error().write_to(socket).ok();
|
||||
|
||||
Reference in New Issue
Block a user