feat(tvix/store/fs): Add support for virtiofs backend

This adds a virtiofs daemon implementation which hooks into the existing
tvix-store filesystem implementation that is used for FUSE.

This allows adding the filesystem to a microvm without having to set up
FUSE inside the guest.

Change-Id: If80c36c9657f2289853e8d9a364bf4f1f7b7559c
Reviewed-on: https://cl.tvl.fyi/c/depot/+/9344
Autosubmit: Connor Brewster <cbrewster@hey.com>
Tested-by: BuildkiteCI
Reviewed-by: flokli <flokli@flokli.de>
This commit is contained in:
Connor Brewster 2023-09-16 13:58:52 -05:00
parent e5f2281856
commit 993c505cdb
6 changed files with 587 additions and 5 deletions

View file

@ -36,6 +36,35 @@ optional = true
# TODO: Switch back to upstream version once https://github.com/cloud-hypervisor/fuse-backend-rs/pull/153 lands.
git = "https://github.com/cbrewster/fuse-backend-rs.git"
branch = "optional-allow_other"
# Ideally this would only be enabled if virtiofs is enabled
# Ex: virtiofs = [..., "fuse-backend-rs/?vhost-user-fs", ...]
# However, crate2nix doesn't properly understand this syntax and doesn't
# enable this feature properly.
features = ["vhost-user-fs"]
[dependencies.vhost]
optional = true
version = "0.6"
[dependencies.vhost-user-backend]
optional = true
version = "0.8"
[dependencies.virtio-queue]
optional = true
version = "0.7"
[dependencies.vm-memory]
optional = true
version = "0.10"
[dependencies.vmm-sys-util]
optional = true
version = "0.11"
[dependencies.virtio-bindings]
optional = true
version = "0.2.1"
[dependencies.tonic-reflection]
optional = true
@ -55,7 +84,8 @@ tempfile = "3.3.0"
tonic-mock = { git = "https://github.com/brainrake/tonic-mock", branch = "bump-dependencies" }
[features]
default = ["fuse", "reflection"]
default = ["fuse", "virtiofs", "reflection"]
fs = ["dep:libc", "dep:fuse-backend-rs"]
virtiofs = ["fs", "dep:vhost", "dep:vhost-user-backend", "dep:virtio-queue", "dep:vm-memory", "dep:vmm-sys-util", "dep:virtio-bindings"]
fuse = ["fs"]
reflection = ["tonic-reflection"]