build: Consolidate sev_snp feature usage

Since igvm is a required feature of sev_snp and also sev_snp is x86-64
only the cfg attributes at build time can be consolidated & simplified.

Signed-off-by: Rob Bradford <rbradford@meta.com>
This commit is contained in:
Rob Bradford
2026-06-12 16:22:11 +01:00
committed by Bo Chen
parent bf3bc325e2
commit 3b9229e434
7 changed files with 29 additions and 115 deletions

View File

@@ -447,10 +447,7 @@ pub struct MshvVcpu {
#[cfg(target_arch = "x86_64")]
msrs: Vec<MsrEntry>,
vm_ops: Option<Arc<dyn vm::VmOps>>,
#[cfg_attr(
all(not(target_arch = "x86_64"), not(feature = "sev_snp")),
expect(dead_code)
)]
#[cfg_attr(not(target_arch = "x86_64"), expect(dead_code))]
vm_fd: Arc<VmFd>,
#[cfg(feature = "sev_snp")]
ghcb: Option<Ghcb>,