From dc6569dbbc8399a4db43baae8f226420386f8e83 Mon Sep 17 00:00:00 2001 From: "alex.lyn" Date: Thu, 6 Apr 2023 16:31:02 +0800 Subject: [PATCH] runtime-rs/virtio-fs: add support extra handler for cache mode. Add support for virtiofsd when virtio_fs_extra_args with "-o cache auto, ..." users specified. Fixes: #6615 Signed-off-by: alex.lyn --- .../crates/hypervisor/src/dragonball/inner_device.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/runtime-rs/crates/hypervisor/src/dragonball/inner_device.rs b/src/runtime-rs/crates/hypervisor/src/dragonball/inner_device.rs index d6f7baecb0..48d9a35085 100644 --- a/src/runtime-rs/crates/hypervisor/src/dragonball/inner_device.rs +++ b/src/runtime-rs/crates/hypervisor/src/dragonball/inner_device.rs @@ -188,6 +188,9 @@ impl DragonballInner { let args: Vec<&str> = opt_list.split(',').collect(); for arg in args { match arg { + "cache=none" => fs_cfg.cache_policy = String::from("none"), + "cache=auto" => fs_cfg.cache_policy = String::from("auto"), + "cache=always" => fs_cfg.cache_policy = String::from("always"), "no_open" => fs_cfg.no_open = true, "open" => fs_cfg.no_open = false, "writeback_cache" => fs_cfg.writeback_cache = true,