runtime-rs: enable/disable selinux in guest based on disable_guest_selinux

This change technically affects the path for enabled guest selinux as well,
however since this is not implemented in runtime-rs anyway nothing should
break.  When guest selinux support is added this change will come handy.

Signed-off-by: Pavel Mores <pmores@redhat.com>
This commit is contained in:
Pavel Mores 2024-08-30 18:29:08 +02:00 committed by Fabiano Fidêncio
parent 204ee21bc8
commit 8c92f3bfec

View File

@ -176,6 +176,10 @@ impl Kernel {
kernel_params.append(&mut KernelParams::from_string(
&config.boot_info.kernel_params,
));
kernel_params.append(&mut KernelParams::from_string(&format!(
"selinux={}",
if config.disable_guest_selinux { 0 } else { 1 }
)));
Ok(Kernel {
path: config.boot_info.kernel.clone(),