From f175dd11341e65fbd91366e9bdc72830d24b2c7f Mon Sep 17 00:00:00 2001 From: Bruce Leidl Date: Mon, 19 Sep 2022 09:52:59 -0400 Subject: [PATCH] Add 'use-fuse' config option to export /dev/fuse to realm. --- libcitadel/src/realm/config.rs | 11 +++++++++++ libcitadel/src/realm/launcher.rs | 4 ++++ 2 files changed, 15 insertions(+) diff --git a/libcitadel/src/realm/config.rs b/libcitadel/src/realm/config.rs index 441ef94..d069f9e 100644 --- a/libcitadel/src/realm/config.rs +++ b/libcitadel/src/realm/config.rs @@ -74,6 +74,9 @@ pub struct RealmConfig { #[serde(rename="use-kvm")] pub use_kvm: Option, + #[serde(rename="use-fuse")] + pub use_fuse: Option, + #[serde(rename="use-gpu")] pub use_gpu: Option, @@ -197,6 +200,7 @@ impl RealmConfig { use_wayland: Some(true), wayland_socket: Some("wayland-0".to_string()), use_kvm: Some(false), + use_fuse: Some(false), use_gpu: Some(false), use_gpu_card0: Some(false), use_network: Some(true), @@ -228,6 +232,7 @@ impl RealmConfig { use_wayland: None, wayland_socket: None, use_kvm: None, + use_fuse: None, use_gpu: None, use_gpu_card0: None, use_network: None, @@ -256,6 +261,12 @@ impl RealmConfig { self.bool_value(|c| c.use_kvm) } + /// If `true` device /dev/fuse will be added to realm + /// + pub fn fuse(&self) -> bool { + self.bool_value(|c| c.use_fuse) + } + /// If `true` render node device /dev/dri/renderD128 will be added to realm. /// /// This enables hardware graphics acceleration in realm. diff --git a/libcitadel/src/realm/launcher.rs b/libcitadel/src/realm/launcher.rs index 55e336e..ea4383c 100644 --- a/libcitadel/src/realm/launcher.rs +++ b/libcitadel/src/realm/launcher.rs @@ -60,6 +60,10 @@ impl <'a> RealmLauncher <'a> { if config.kvm() { self.add_device("/dev/kvm"); } + if config.fuse() { + self.add_device("/dev/fuse"); + } + if config.gpu() { self.add_device("/dev/dri/renderD128"); if config.gpu_card0() {