diff --git a/hypervisor/src/mshv/mod.rs b/hypervisor/src/mshv/mod.rs index 516b81bbf..19f657e06 100644 --- a/hypervisor/src/mshv/mod.rs +++ b/hypervisor/src/mshv/mod.rs @@ -251,6 +251,7 @@ impl hypervisor::Hypervisor for MshvHypervisor { } // Set additional partition property for SEV-SNP partition. + let mut _sev_snp_enabled = mshv_vm_type == VmType::Snp; if mshv_vm_type == VmType::Snp { let snp_policy = snp::get_default_snp_guest_policy(); let vmgexit_offloads = snp::get_default_vmgexit_offload_features(); @@ -306,6 +307,8 @@ impl hypervisor::Hypervisor for MshvHypervisor { fd: vm_fd, msrs, dirty_log_slots: Arc::new(RwLock::new(HashMap::new())), + #[cfg(feature = "sev_snp")] + sev_snp_enabled: _sev_snp_enabled, })) } @@ -1467,6 +1470,8 @@ pub struct MshvVm { fd: Arc, msrs: Vec, dirty_log_slots: Arc>>, + #[cfg(feature = "sev_snp")] + sev_snp_enabled: bool, } impl MshvVm {