mirror of
https://github.com/kata-containers/kata-containers.git
synced 2026-04-09 21:42:14 +00:00
docs: update shared filesystem documentation and tests
(1) Update annotations documentation to reflect new shared filesystem
options (virtio-fs, inline-virtio-fs, virtio-fs-nydus, none).
(2) Replace virtio-9p references with inline-virtio-fs in config doc.
(3) Update drop-in configuration tests to use 'none' instead of 'virtio-9p'
Signed-off-by: Alex Lyn <alex.lyn@antgroup.com>
This commit is contained in:
committed by
Fabiano Fidêncio
parent
d6546f2a56
commit
f133b81579
@@ -257,7 +257,7 @@ pub const KATA_ANNO_CFG_HYPERVISOR_ENABLE_ROOTLESS_HYPERVISOR: &str =
|
||||
"io.katacontainers.config.hypervisor.rootless";
|
||||
|
||||
// Hypervisor Shared File System related annotations
|
||||
/// A sandbox annotation to specify the shared file system type, either inline-virtio-fs (default), virtio-9p, virtio-fs or virtio-fs-nydus.
|
||||
/// A sandbox annotation to specify the shared file system type, either virtio-fs(default), inline-virtio-fs, virtio-fs-nydus or none.
|
||||
pub const KATA_ANNO_CFG_HYPERVISOR_SHARED_FS: &str =
|
||||
"io.katacontainers.config.hypervisor.shared_fs";
|
||||
/// A sandbox annotations to specify virtio-fs vhost-user daemon path.
|
||||
|
||||
@@ -346,7 +346,7 @@ mod drop_in_directory_handling {
|
||||
|
||||
let dropin_override_data = r#"
|
||||
[hypervisor.qemu]
|
||||
shared_fs = "virtio-9p"
|
||||
shared_fs = "none"
|
||||
[runtime]
|
||||
vfio_mode="vfio"
|
||||
"#;
|
||||
@@ -372,7 +372,7 @@ mod drop_in_directory_handling {
|
||||
assert_eq!(config.hypervisor["qemu"].device_info.default_bridges, 4);
|
||||
assert_eq!(
|
||||
config.hypervisor["qemu"].shared_fs.shared_fs.as_deref(),
|
||||
Some("virtio-9p")
|
||||
Some("none")
|
||||
);
|
||||
assert!(config.runtime.debug);
|
||||
assert!(config.runtime.sandbox_cgroup_only);
|
||||
|
||||
@@ -1418,12 +1418,13 @@ impl SecurityInfo {
|
||||
}
|
||||
}
|
||||
|
||||
/// Configuration information for shared filesystems, such as virtio-9p and virtio-fs.
|
||||
/// Configuration information for shared filesystems, such as virtio-fs-nydus and virtio-fs.
|
||||
#[derive(Clone, Debug, Default, Deserialize, Serialize)]
|
||||
pub struct SharedFsInfo {
|
||||
/// Type of shared file system to use:
|
||||
/// - `virtio-fs` (default)
|
||||
/// - `virtio-9p`
|
||||
/// - `inline-virtio-fs`
|
||||
/// - `virtio-fs-nydus`
|
||||
/// - `none` (disables shared filesystem)
|
||||
pub shared_fs: Option<String>,
|
||||
|
||||
@@ -1476,7 +1477,7 @@ impl SharedFsInfo {
|
||||
/// Adjusts the shared filesystem configuration after loading from a configuration file.
|
||||
///
|
||||
/// Handles default values for `shared_fs` type, `virtio-fs` specific settings
|
||||
/// (daemon path, cache mode, DAX), and `virtio-9p` msize.
|
||||
/// (daemon path, cache mode, DAX) or `inline-virtio-fs` settings.
|
||||
pub fn adjust_config(&mut self) -> Result<()> {
|
||||
if self.shared_fs.as_deref() == Some(NO_VIRTIO_FS) {
|
||||
self.shared_fs = None;
|
||||
@@ -1503,7 +1504,7 @@ impl SharedFsInfo {
|
||||
/// Validates the shared filesystem configuration.
|
||||
///
|
||||
/// Checks the validity of the selected `shared_fs` type and
|
||||
/// performs specific validations for `virtio-fs` and `virtio-9p` settings.
|
||||
/// performs specific validations for `virtio-fs` and `inline-virtio-fs` settings.
|
||||
pub fn validate(&self) -> Result<()> {
|
||||
match self.shared_fs.as_deref() {
|
||||
None => Ok(()),
|
||||
|
||||
Reference in New Issue
Block a user