vmm: tdx: Make sure a TDX enabled binary can be used for non-TDX

It's important to maintain the ability to run in a non-TDX environment
a Cloud Hypervisor binary with the 'tdx' feature enabled.

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
This commit is contained in:
Sebastien Boeuf 2021-12-17 12:14:52 +01:00
parent 8813456aef
commit 4a47cdcebd

View File

@ -1989,7 +1989,11 @@ impl Vm {
.map_err(Error::CpuManager)?;
#[cfg(feature = "tdx")]
let sections = self.extract_tdvf_sections()?;
let sections = if self.config.lock().unwrap().tdx.is_some() {
self.extract_tdvf_sections()?
} else {
Vec::new()
};
#[cfg(feature = "acpi")]
let rsdp_addr = {