From b50f803a4e17bc43f38b636029d548a4a4c20c92 Mon Sep 17 00:00:00 2001 From: Alex Lyn Date: Tue, 31 Mar 2026 11:56:45 +0800 Subject: [PATCH] kata-types: add virtio-fs-nydus shared fs configuration support Add "virtio-fs-nydus" as a recognized shared filesystem type in the hypervisor configuration. This enables the standalone nydusd mode where nydusd runs as a separate process alongside virtiofsd. The key changes: (1) Add VIRTIO_FS_NYDUS constant for the new shared fs type. (2) Register virtio-fs-nydus in adjust() and validate() paths, reusing the same virtio-fs validation logic since both use vhost-user protocol Signed-off-by: Alex Lyn --- src/libs/kata-types/src/config/hypervisor/mod.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/libs/kata-types/src/config/hypervisor/mod.rs b/src/libs/kata-types/src/config/hypervisor/mod.rs index 8edfeaacd7..b66c7ac200 100644 --- a/src/libs/kata-types/src/config/hypervisor/mod.rs +++ b/src/libs/kata-types/src/config/hypervisor/mod.rs @@ -70,6 +70,7 @@ pub use self::firecracker::{FirecrackerConfig, HYPERVISOR_NAME_FIRECRACKER}; const NO_VIRTIO_FS: &str = "none"; const VIRTIO_FS: &str = "virtio-fs"; const VIRTIO_FS_INLINE: &str = "inline-virtio-fs"; +const VIRTIO_FS_NYDUS: &str = "virtio-fs-nydus"; const MAX_BRIDGE_SIZE: u32 = 5; const MAX_NETWORK_QUEUES: u32 = 256; @@ -1528,6 +1529,7 @@ impl SharedFsInfo { match self.shared_fs.as_deref() { Some(VIRTIO_FS) => self.adjust_virtio_fs(false)?, Some(VIRTIO_FS_INLINE) => self.adjust_virtio_fs(true)?, + Some(VIRTIO_FS_NYDUS) => self.adjust_virtio_fs(false)?, _ => {} } @@ -1543,6 +1545,7 @@ impl SharedFsInfo { None => Ok(()), Some(VIRTIO_FS) => self.validate_virtio_fs(false), Some(VIRTIO_FS_INLINE) => self.validate_virtio_fs(true), + Some(VIRTIO_FS_NYDUS) => self.validate_virtio_fs(false), Some(v) => Err(std::io::Error::other(format!("Invalid shared_fs type {v}"))), } }