diff --git a/src/main.rs b/src/main.rs index f24936d4c..1a0c17f7d 100644 --- a/src/main.rs +++ b/src/main.rs @@ -430,7 +430,7 @@ fn start_vmm(cmd_arguments: ArgMatches, api_socket_path: &str) -> Result<(), Err // Can't test for "vm-config" group as some have default values. The kernel // is the only required option for booting the VM. - if cmd_arguments.is_present("kernel") { + if cmd_arguments.is_present("kernel") || cmd_arguments.is_present("tdx") { let vm_params = config::VmParams::from_arg_matches(&cmd_arguments); let vm_config = config::VmConfig::parse(vm_params).map_err(Error::ParsingConfig)?; diff --git a/vmm/src/config.rs b/vmm/src/config.rs index c5476a414..e97067950 100644 --- a/vmm/src/config.rs +++ b/vmm/src/config.rs @@ -1531,6 +1531,7 @@ pub struct VmConfig { impl VmConfig { pub fn validate(&self) -> ValidationResult<()> { + #[cfg(not(feature = "tdx"))] self.kernel.as_ref().ok_or(ValidationError::KernelMissing)?; if self.console.mode == ConsoleOutputMode::Tty && self.serial.mode == ConsoleOutputMode::Tty