From a33a22ccd1ddfb7e067f384fe33b042f98181e78 Mon Sep 17 00:00:00 2001 From: Zhongtao Hu Date: Tue, 10 Jan 2023 18:15:45 +0800 Subject: [PATCH] runtime-rs: add missing config section for share-fs add missing config sections for share-fs Fixes:#6020 Signed-off-by: Zhongtao Hu --- .../kata-types/src/config/hypervisor/mod.rs | 4 +++ src/runtime-rs/Makefile | 2 ++ .../config/configuration-dragonball.toml.in | 28 +++++++++++++++++++ 3 files changed, 34 insertions(+) diff --git a/src/libs/kata-types/src/config/hypervisor/mod.rs b/src/libs/kata-types/src/config/hypervisor/mod.rs index aba5c751b6..d3dff69142 100644 --- a/src/libs/kata-types/src/config/hypervisor/mod.rs +++ b/src/libs/kata-types/src/config/hypervisor/mod.rs @@ -779,6 +779,10 @@ pub struct SharedFsInfo { #[serde(default)] pub virtio_fs_cache_size: u32, + /// Default size of virtqueues + #[serde(default)] + pub virtio_fs_queue_size: u32, + /// Enable virtio-fs DAX window if true. #[serde(default)] pub virtio_fs_is_dax: bool, diff --git a/src/runtime-rs/Makefile b/src/runtime-rs/Makefile index ea97517389..ffe7a934bc 100644 --- a/src/runtime-rs/Makefile +++ b/src/runtime-rs/Makefile @@ -119,6 +119,7 @@ DEFVALIDVIRTIOFSDAEMONPATHS := [\"$(DEFVIRTIOFSDAEMON)\"] # if value is 0, DAX is not enabled DEFVIRTIOFSCACHESIZE ?= 0 DEFVIRTIOFSCACHE ?= auto +DEFVIRTIOFSQUEUESIZE ?= 1024 # Format example: # [\"-o\", \"arg1=xxx,arg2\", \"-o\", \"hello world\", \"--arg3=yyy\"] # @@ -256,6 +257,7 @@ USER_VARS += DEFVIRTIOFSDAEMON USER_VARS += DEFVALIDVIRTIOFSDAEMONPATHS USER_VARS += DEFVIRTIOFSCACHESIZE USER_VARS += DEFVIRTIOFSCACHE +USER_VARS += DEFVIRTIOFSQUEUESIZE USER_VARS += DEFVIRTIOFSEXTRAARGS USER_VARS += DEFENABLEANNOTATIONS USER_VARS += DEFENABLEIOTHREADS diff --git a/src/runtime-rs/config/configuration-dragonball.toml.in b/src/runtime-rs/config/configuration-dragonball.toml.in index ca1db2681a..fa39d23c82 100644 --- a/src/runtime-rs/config/configuration-dragonball.toml.in +++ b/src/runtime-rs/config/configuration-dragonball.toml.in @@ -136,6 +136,34 @@ block_device_driver = "@DEFBLOCKSTORAGEDRIVER_DB@" # of shim, does not need an external virtiofsd process. shared_fs = "@DBSHAREDFS@" +# Default size of DAX cache in MiB +virtio_fs_cache_size = @DEFVIRTIOFSCACHESIZE@ + +# Extra args for virtiofsd daemon +# +# Format example: +# ["-o", "arg1=xxx,arg2", "-o", "hello world", "--arg3=yyy"] +# Examples: +# Set virtiofsd log level to debug : ["-o", "log_level=debug"] or ["-d"] +# +# see `virtiofsd -h` for possible options. +virtio_fs_extra_args = @DEFVIRTIOFSEXTRAARGS@ + +# Cache mode: +# +# - never +# Metadata, data, and pathname lookup are not cached in guest. They are +# always fetched from host and any changes are immediately pushed to host. +# +# - auto +# Metadata and pathname lookup cache expires after a configured amount of +# time (default is 1 second). Data is cached while the file is open (close +# to open consistency). +# +# - always +# Metadata, data, and pathname lookup are cached in guest and never expire. +virtio_fs_cache = "@DEFVIRTIOFSCACHE@" + # Enable huge pages for VM RAM, default false # Enabling this will result in the VM memory # being allocated using huge pages.