mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2025-02-22 11:22:26 +00:00
vmm: tdx: Reject attempt to use --kernel with --tdx
Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
parent
c400702272
commit
30b74e74cd
@ -126,6 +126,9 @@ pub enum ValidationError {
|
||||
// CPU Hotplug not permitted with TDX
|
||||
#[cfg(feature = "tdx")]
|
||||
TdxNoCpuHotplug,
|
||||
// Specifying kernel not permitted with TDX
|
||||
#[cfg(feature = "tdx")]
|
||||
TdxKernelSpecified,
|
||||
// Insuffient vCPUs for queues
|
||||
TooManyQueues,
|
||||
}
|
||||
@ -168,6 +171,10 @@ impl fmt::Display for ValidationError {
|
||||
TdxNoCpuHotplug => {
|
||||
write!(f, "CPU hotplug not possible with TDX")
|
||||
}
|
||||
#[cfg(feature = "tdx")]
|
||||
TdxKernelSpecified => {
|
||||
write!(f, "Direct kernel boot not possible with TDX")
|
||||
}
|
||||
TooManyQueues => {
|
||||
write!(f, "Number of vCPUs is insufficient for number of queues")
|
||||
}
|
||||
@ -1751,6 +1758,9 @@ impl VmConfig {
|
||||
if tdx_enabled && (self.cpus.max_vcpus != self.cpus.boot_vcpus) {
|
||||
return Err(ValidationError::TdxNoCpuHotplug);
|
||||
}
|
||||
if tdx_enabled && self.kernel.is_some() {
|
||||
return Err(ValidationError::TdxKernelSpecified);
|
||||
}
|
||||
}
|
||||
|
||||
if self.console.mode == ConsoleOutputMode::Tty && self.serial.mode == ConsoleOutputMode::Tty
|
||||
|
Loading…
x
Reference in New Issue
Block a user