mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2025-02-22 19:32:20 +00:00
vmm: fix KVM clock lost during restore form snapshot
Connecting a restored KVM clock vm will take long time, as clock is NOT restored immediately after vm resume from snapshot. this is because 9ce6c3b incorrectly remove vm_snapshot.clock, and always pass None to new_from_memory_manager, which will result to kvm_set_clock() never be called during restore from snapshot. Fixes: 9ce6c3b Signed-off-by: Ren Lei <ren.lei4@zte.com.cn>
This commit is contained in:
parent
75ad89670b
commit
324c924ca4
@ -498,7 +498,9 @@ impl Vm {
|
||||
reset_evt: EventFd,
|
||||
seccomp_action: &SeccompAction,
|
||||
hypervisor: Arc<dyn hypervisor::Hypervisor>,
|
||||
#[cfg(feature = "kvm")] _saved_clock: Option<hypervisor::ClockData>,
|
||||
#[cfg(all(feature = "kvm", target_arch = "x86_64"))] _saved_clock: Option<
|
||||
hypervisor::ClockData,
|
||||
>,
|
||||
activate_evt: EventFd,
|
||||
) -> Result<Self> {
|
||||
config
|
||||
@ -718,7 +720,7 @@ impl Vm {
|
||||
reset_evt,
|
||||
seccomp_action,
|
||||
hypervisor,
|
||||
#[cfg(feature = "kvm")]
|
||||
#[cfg(all(feature = "kvm", target_arch = "x86_64"))]
|
||||
None,
|
||||
activate_evt,
|
||||
)?;
|
||||
@ -783,8 +785,8 @@ impl Vm {
|
||||
reset_evt,
|
||||
seccomp_action,
|
||||
hypervisor,
|
||||
#[cfg(feature = "kvm")]
|
||||
None,
|
||||
#[cfg(all(feature = "kvm", target_arch = "x86_64"))]
|
||||
vm_snapshot.clock,
|
||||
activate_evt,
|
||||
)
|
||||
}
|
||||
@ -821,7 +823,7 @@ impl Vm {
|
||||
reset_evt,
|
||||
seccomp_action,
|
||||
hypervisor,
|
||||
#[cfg(feature = "kvm")]
|
||||
#[cfg(all(feature = "kvm", target_arch = "x86_64"))]
|
||||
None,
|
||||
activate_evt,
|
||||
)
|
||||
|
Loading…
x
Reference in New Issue
Block a user