VirtIO-FS: A Proposed Better Approach For Sharing Folders/Files With Guest VMs
VirtIO-FS was developed out of the need to share folders/files with guest VMs in a fast, consistent, and secure manner. They designed VirtIO-FS for Kata containers but coud be used with other VMs too. The closest existing project to fulfilling their needs was Virtio-9p, but there were performance issues and other factors leading them to designing this new solution.
How virtio-fs differs from existing approaches
The unique idea behind virtio-fs is to take advantage of the co-location of the virtual machine and hypervisor to avoid communication (vmexits).
DAX allows file contents to be accessed without communication with the hypervisor. The shared memory region for metadata avoids communication in the common case where metadata is unchanged.
By replacing expensive communication with cheaper shared memory accesses, we expect to achieve better performance than approaches based on network file system protocols. In addition, this also makes it easier to achieve local file system semantics (coherency).
These techniques are not applicable to network file system protocols since the communications channel is bypassed by taking advantage of shared memory on a local machine. This is why we decided to build virtio-fs rather than focus on 9P or NFS.
Initial benchmark results on VirtIO-FS are promising, especially for being based upon FUSE. Early numbers and other details on this initial proposal and preliminary patches can be found via this kernel patch series.