From 8c92f3bfec267d8f0dbc8edccc2d72ca4054253f Mon Sep 17 00:00:00 2001 From: Pavel Mores Date: Fri, 30 Aug 2024 18:29:08 +0200 Subject: [PATCH] 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 --- .../crates/hypervisor/src/qemu/cmdline_generator.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/runtime-rs/crates/hypervisor/src/qemu/cmdline_generator.rs b/src/runtime-rs/crates/hypervisor/src/qemu/cmdline_generator.rs index c00f3204f..7fa49b96c 100644 --- a/src/runtime-rs/crates/hypervisor/src/qemu/cmdline_generator.rs +++ b/src/runtime-rs/crates/hypervisor/src/qemu/cmdline_generator.rs @@ -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(),