From a5a41bf797bbd7639f9dd88f2f9335780cb25ada Mon Sep 17 00:00:00 2001 From: Muminul Islam Date: Thu, 2 May 2024 12:11:21 -0700 Subject: [PATCH] hypervisor: always create a frozen partition Create a partition frozen always, then unfreeze the partition during boot phase or resume phase. We also freeze the partition during pause event. Time is freeze during the time between freeze and unfreeze. Signed-off-by: Muminul Islam --- hypervisor/src/mshv/mod.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/hypervisor/src/mshv/mod.rs b/hypervisor/src/mshv/mod.rs index bd5e9dfb3..3abb7ddaa 100644 --- a/hypervisor/src/mshv/mod.rs +++ b/hypervisor/src/mshv/mod.rs @@ -310,6 +310,13 @@ impl hypervisor::Hypervisor for MshvHypervisor { ) .map_err(|e| hypervisor::HypervisorError::SetPartitionProperty(e.into()))?; + // Always create a frozen partition + fd.set_partition_property( + hv_partition_property_code_HV_PARTITION_PROPERTY_TIME_FREEZE, + 1u64, + ) + .map_err(|e| hypervisor::HypervisorError::SetPartitionProperty(e.into()))?; + let vm_fd = Arc::new(fd); #[cfg(target_arch = "x86_64")]