mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2024-10-02 11:35:46 +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 because9ce6c3b
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,
|
reset_evt: EventFd,
|
||||||
seccomp_action: &SeccompAction,
|
seccomp_action: &SeccompAction,
|
||||||
hypervisor: Arc<dyn hypervisor::Hypervisor>,
|
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,
|
activate_evt: EventFd,
|
||||||
) -> Result<Self> {
|
) -> Result<Self> {
|
||||||
config
|
config
|
||||||
@ -718,7 +720,7 @@ impl Vm {
|
|||||||
reset_evt,
|
reset_evt,
|
||||||
seccomp_action,
|
seccomp_action,
|
||||||
hypervisor,
|
hypervisor,
|
||||||
#[cfg(feature = "kvm")]
|
#[cfg(all(feature = "kvm", target_arch = "x86_64"))]
|
||||||
None,
|
None,
|
||||||
activate_evt,
|
activate_evt,
|
||||||
)?;
|
)?;
|
||||||
@ -783,8 +785,8 @@ impl Vm {
|
|||||||
reset_evt,
|
reset_evt,
|
||||||
seccomp_action,
|
seccomp_action,
|
||||||
hypervisor,
|
hypervisor,
|
||||||
#[cfg(feature = "kvm")]
|
#[cfg(all(feature = "kvm", target_arch = "x86_64"))]
|
||||||
None,
|
vm_snapshot.clock,
|
||||||
activate_evt,
|
activate_evt,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@ -821,7 +823,7 @@ impl Vm {
|
|||||||
reset_evt,
|
reset_evt,
|
||||||
seccomp_action,
|
seccomp_action,
|
||||||
hypervisor,
|
hypervisor,
|
||||||
#[cfg(feature = "kvm")]
|
#[cfg(all(feature = "kvm", target_arch = "x86_64"))]
|
||||||
None,
|
None,
|
||||||
activate_evt,
|
activate_evt,
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user