-
Notifications
You must be signed in to change notification settings - Fork 328
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for fuse_custom_io feature #510
Comments
this is the first time I hear of this. Some notes to myself:
Open questions:
|
There is a simple test case in libfuse and it justs transmits FUSE_INIT message on application-defined I/O functions, which is unix socket here, other than /dev/fuse. For myself, I also think it's hard to have a full test with normal tools on hand, but it's a useful feature in certain cases. Currently I used it in dpu, dpu can help to offload virtiofsd or filesystem server from host machine to dpu,in this case,host machine and dpu runs different os, softwares on dpu will fetch vritio-fs reqeusts from dpu hardware, and use fuse_custom_io to define I/O functions, then we can use these I/O functions to interactive with filesystem server based on libfuse。
I'm not sure, virtio-fs is widely used, seems that it doest not require the guest os is trusted. |
I looked at this a bit more. It is easy to make go-fuse read from a socket, but this is by far not enough to have the FS be accessible in QEMU or other hypervisors. The spec is here To note, FS spec is in section 5.11, https://docs.oasis-open.org/virtio/virtio/v1.2/csd01/virtio-v1.2-csd01.html#x1-45800011 The FUSE protocol is followed, but communication goes over so-called virtq, described in sec 2.6. Before the FUSE protocol kicks in, there is a general negotiation that looks a bit like this in strace (tracing Rust virtiofs-d),
Note that virtio is a general mechanism to provide device drivers (block storage, GPU, tty, crypto-random, etc.) from the host to the guest. The opcodes are transferred through some shared memory shenenigans using virtqueues
note how the Init opcode (26 = \32) is not transferred through a recvmsg syscall. |
I toyed with this over the last month, there is an alpha quality Virtio implementation in hte virtiofs branch, https://github.com/hanwen/go-fuse/tree/virtiofs it uses a |
Libfuse C language library supports the fuse_custom_io feature initially in below commit:
libfuse/libfuse@50c74e6
Traditionally fuse filesystem servers read fuse requests and write fuse responses by /dev/fuse character device, but in the case of virtiofs, fuse requests come from guest os, fuse filesystem servers run in host os, so /dev/fuse won't work here.
Many popular fuse filesystems based on go-fuse library, in the case of qemu virtiofs or dpu virtiofs, by fuse_custom_io feature, user can implement application-defined I/O functions to fetch and reply fuse requests. then we can let these fuse filesystems based on go-fuse deploied on host running qumu or dpu easily with least modifications.
Could the go-fuse community plan to support this fuse_custom_io feature(backport above patch)? Thanks in advance, for me, currently I did't write any go codes yet.
The text was updated successfully, but these errors were encountered: