Add 'use-fuse' config option to export /dev/fuse to realm.

This commit is contained in:
Bruce Leidl 2022-09-19 09:52:59 -04:00
parent dc6ddc4e85
commit f175dd1134
2 changed files with 15 additions and 0 deletions

View File

@ -74,6 +74,9 @@ pub struct RealmConfig {
#[serde(rename="use-kvm")]
pub use_kvm: Option<bool>,
#[serde(rename="use-fuse")]
pub use_fuse: Option<bool>,
#[serde(rename="use-gpu")]
pub use_gpu: Option<bool>,
@ -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.

View File

@ -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() {