From 1b9ce69afab4f95a81b38dbc3b00f427d99ffd44 Mon Sep 17 00:00:00 2001 From: Jinank Jain Date: Tue, 29 Aug 2023 16:34:43 +0000 Subject: [PATCH] src: Add compile time check for SNP and TDX We need to make sure that SEV-SNP and TDX are not enabled at the same time. As these two features belong to mutually exclusive hardware vendors. So, we should make sure that these two features are not enabled at the same. Thus, a compile time check for it. Signed-off-by: Jinank Jain --- src/main.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main.rs b/src/main.rs index ba49a4c14..9521b7afb 100644 --- a/src/main.rs +++ b/src/main.rs @@ -662,6 +662,9 @@ fn start_vmm(toplevel: TopLevel) -> Result, Error> { } fn main() { + #[cfg(all(feature = "tdx", feature = "sev_snp"))] + compile_error!("Feature 'tdx' and 'sev_snp' are mutually exclusive."); + #[cfg(feature = "dhat-heap")] let _profiler = dhat::Profiler::new_heap();