-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
[WIP] Implement VirtioFS device backend #1351
Conversation
match self.in_header.opcode { | ||
fuse_opcode_FUSE_INIT => fs.do_init(self), | ||
fuse_opcode_FUSE_GETATTR => fs.do_getattr(self), | ||
fuse_opcode_FUSE_LOOKUP => fs.do_lookup(self), | ||
fuse_opcode_FUSE_OPENDIR => fs.do_opendir(self), | ||
fuse_opcode_FUSE_READDIR => fs.do_readdir(self), | ||
fuse_opcode_FUSE_ACCESS => fs.do_access(self), | ||
fuse_opcode_FUSE_FORGET => fs.do_forget(self), | ||
fuse_opcode_FUSE_RELEASEDIR => fs.do_releasedir(self), | ||
fuse_opcode_FUSE_STATFS => fs.do_statfs(self), | ||
fuse_opcode_FUSE_MKNOD => fs.do_mknod(self), | ||
fuse_opcode_FUSE_MKDIR => fs.do_mkdir(self), | ||
fuse_opcode_FUSE_RMDIR => fs.do_rmdir(self), | ||
fuse_opcode_FUSE_SETATTR => fs.do_setattr(self), | ||
fuse_opcode_FUSE_UNLINK => fs.do_unlink(self), | ||
fuse_opcode_FUSE_SYMLINK => fs.do_symlink(self), | ||
fuse_opcode_FUSE_READLINK => fs.do_readlink(self), | ||
_ => Err(ExecuteError::InvalidMethod), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Considering the number of functions, you should considering adding a HashMap between fuse_opcode_*
and Fn<&mut FuseBackend>
. I would also consider moving the execute(op) inside the FuseBackend, as maybe some backends would not support all the operations.
I'm very excited to see the progress on this, because this is the major blocker for adopting Firecracker at RunKit. In the process of trying to get it to run, I noticed that #1319 was merged around the time this PR was submitted, and as of that merge, this PR no longer applies cleanly to master. Any chance you have time to rebase this branch and make it compatible with the new API server code? |
To put thing in context: this is the kind of thing we need to really reflect on before merging since it's both a large piece of functionality, and a large new attack surface. We haven't gotten around to do this yet. |
I'm working hard to implement all the necessary fuse functions now. After that, I will rebase the code and update this PR. It will be soon. |
I cannot agree more. Fuse require all filesystem-related syscall and could be very dangerous to manipulate for attacking the host. Besides, I am thinking about a safer and more controllable way to implement Host Filesystem Sharing: What about |
Thinking a little more about this, I wonder if read-only access to the host filesystem would be a good (initial?) compromise in terms of functionality and security. It would satisfy our use case at RunKit, and, from my reading of kata-containers/runtime#1071, it seems like it'd support a number of other use cases as well. |
One big drawback of firecracker today is I/O performance, even write IO. |
Hi! How is the progress? This feature is very desirable. Right now it blocks me from fully using firecracker :) |
Hi @zmlcc , @paulbaumgart , @kainosnoema @KawaiDesu . I embarrassingly failed to follow up here all this time. Apologies for that. We did look at
Mapping these findings onto Firecracker's core mission and tenets led us to not prioritize this feature this year, and frankly I don't think the above will change enough for us to build it outright in Firecracker proper. There are two other future-looking paths:
Both of these are long-term solutions we don't think there's a 2020 solution for virtio-fs. Thank being said ... @zmlcc I'm curious about the @kainosnoema , you're right, I/O performance is currently a gap in Firecracker. We've done some prototyping with io_uring [1] and we think that's a very good next step to take on the I/O front: it will greatly improve the efficiency of how we use our single emulation thread. We'll probably add that to our roadmap soon, along with the rest of the findings from our I/O experiments. |
Closing this for now with the above reasoning. Please re-open to continue the conversation here! 😄 |
Given the user demand for this feature, was the primary reason around non-acceptance mostly security and complexity? Its been a few years, now theres a reasonably stable/proven
@raduweiss thoughts on this architecture? Would this be palatable as a PR? |
Reason for This PR
Use virtio-fs as backend device to implement Host Filesystem Sharing #1180
Description of Changes
devices
andvmm
/vtfs
request in api_serverfuse_gen
package to support fuse protocolsys_util
License Acceptance
By submitting this pull request, I confirm that my contribution is made under
the terms of the Apache 2.0 license.
PR Checklist
git commit -s
).clearly provided.
doc changes are included in this PR. Docs in scope are all
*.md
fileslocated either in the repository root, or in the
docs/
directory.code is included in this PR.
reflected in
firecracker/swagger.yaml
.this PR have user impact and have been added to the
CHANGELOG.md
file.Status Description
The whole work are still in process. I would like to let the community make a technical preview and discussion. Is the virtio-fs backend a viable and safe way to implement host filesystem sharing ? Is work in this direction worth continuing ?
Up to now, the basic framework has been established and parts of fuse features were implemented. With kernel v5.4-rc3, it has passed
mkdir
tests of pjdfstest. The next work may include