Conversation
a5a3acf to
967f281
Compare
There was a problem hiding this comment.
Pull request overview
Implements POSIX/WASI-like open_at behavior in the in-memory VFS so guests can open existing nodes and create/truncate files (a prerequisite for enabling host-side FS writes), and updates unit/integration tests to reflect the new semantics.
Changes:
- Refactors VFS path resolution and expands
VfsCtxView::open_atto handleCREATE,EXCLUSIVE,DIRECTORY, andTRUNCATE. - Adds extensive unit tests around
open_atbehavior and updates integration test expectations/snapshots. - Makes
Limiter::growtake&self(internally synchronized), simplifying ownership/mutability in component setup.
Reviewed changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| host/src/vfs/mod.rs | Implements new open_at semantics, factors path traversal helper, and adds unit tests. |
| host/src/limiter.rs | Changes grow to &self to allow shared use behind a mutex. |
| host/src/component.rs | Adjusts limiter initialization to match the new Limiter::grow signature/usage. |
| host/tests/integration_tests/python/runtime/fs.rs | Updates Python FS integration test to exercise create-on-open behavior. |
| host/tests/integration_tests/evil/fs.rs | Updates large snapshot expectations for new VFS/open behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
d7bd5c4 to
adb81f9
Compare
…riptorFlags::Write
| let limiter = Limiter::new(self.static_limits, &pool); | ||
| let vfs_state = VfsState::new(limits, limiter); | ||
| let table = ResourceTable::new(); | ||
| (table, vfs_state) |
There was a problem hiding this comment.
We return a non-mutable tuple here instead of the VfsCtxView directly, as wrapping these in the VfsCtxView requires that they be mutable references, and rustc doesn't like that 😞
6278d31 to
9d61c8c
Compare
| | | . | ERR: Is a directory (os error 31) | | ||
| | | .. | ERR: Is a directory (os error 31) | | ||
| | | / | ERR: Is a directory (os error 31) | | ||
| | | /bin | ERR: Bad file descriptor (os error 8) | |
There was a problem hiding this comment.
Shouldn't this result in "invalid" or "not found" or something? "Bad file descriptor" kinda sound like an internal mess-up.
862b2a5 to
259bdb4
Compare
…et_node_from_start
71e926e to
c750feb
Compare
Closes #336
I followed the specification described here. Given that we will eventually need to test this against the wasi test-suite, any differences between the aforementioned spec and the test-suite will favor the test-suite; so significant changes may need to be made in the future.
Describe your proposed changes here.