Repository navigation
Separate Cloud Hypervisor mount-tree staging from verification and utilities - #11601
Merged
Merged
Conversation
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
lpcox
marked this pull request as ready for review
November 14, 2026 19:52
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues remain for the host mount-tree refactor.
No open issues 🎉
What changed in this PR
Refactors the Cloud Hypervisor host mount-tree implementation used by virtiofsd, separating verification and utilities from privileged staging without changing enforcement behavior.
Changes:
- Extracts verification, path handling, and mountinfo parsing into focused modules.
- Keeps staging, ownership tracking, retries, unmounting, and rollback in
StagedHostMountTree, with compatibility re-exports. - Adds direct tests for path boundaries, escaped and stacked mount records, and fail-closed verification.
| File | Description |
|---|---|
src/cloud-hypervisor/mount-tree.ts |
Delegates checks and utilities while retaining staging and rollback. |
src/cloud-hypervisor/mount-tree-verify.ts |
Isolates canonical-path, mount-hardening, overlay, mask, and propagation checks. |
src/cloud-hypervisor/mount-tree-verify.test.ts |
Tests filesystem validation and mount enforcement checks. |
src/cloud-hypervisor/mount-tree-paths.ts |
Extracts path validation, containment, overlap, and staging helpers. |
src/cloud-hypervisor/mount-tree-paths.test.ts |
Tests path safety boundaries and destination mapping. |
src/cloud-hypervisor/mount-tree-parse.ts |
Extracts mountinfo parsing and exact/tree-scoped reads. |
src/cloud-hypervisor/mount-tree-parse.test.ts |
Tests escapes, stacked records, scope filtering, and read errors. |
Review effort: Max (dynamic)
Contributor
|
✅ Copilot review passed with no inline comments. @lpcox Add the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The mount-tree module mixes privileged staging, rollback, isolation verification, and parsing utilities. This refactor separates those concerns without changing enforcement behavior.
mount-tree-verify.ts: canonical-path, read-only, writable-overlay, mask, hardening, and propagation checks.mount-tree-paths.ts: path validation, containment, overlap detection, and staged-path mapping.mount-tree-parse.ts: mountinfo parsing and exact/tree-scoped reads.StagedHostMountTree.