check: Relax the unrestricted_guest check when running in a VM

When running on a VM, the kernel parameter "unrestricted_guest" for
kernel module "kvm_intel" is not required. So, return success when running
on a VM without checking value of this kernel parameter.

Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
This commit is contained in:
Archana Shinde 2023-06-21 07:30:35 -07:00
parent 1b406b9d0c
commit 610f7986e4

View File

@ -238,13 +238,9 @@ mod arch_specific {
let running_on_vmm_alt = running_on_vmm()?;
// Kernel param "unrestricted_guest" is not required when running under a hypervisor
if running_on_vmm_alt {
let msg = format!("You are running in a VM, where the kernel module '{}' parameter '{:}' has a value '{:}'. This causes conflict when running kata.",
module,
param_name,
param_value_host
);
return Err(anyhow!(msg));
return Ok(());
}
if param_value_host == expected_param_value.to_string() {