Skip to content

Separate Cloud Hypervisor mount-tree staging from verification and utilities - #11601

Merged
lpcox merged 2 commits into
mainfrom
copilot/refactor-mount-tree-module
Nov 14, 2026
Merged

lpcox merged 2 commits into
mainfrom
copilot/refactor-mount-tree-module

Conversation

@lpcox

@lpcox lpcox commented Nov 14, 2026 •

Copy link
Copy Markdown
Collaborator

The mount-tree module mixes privileged staging, rollback, isolation verification, and parsing utilities. This refactor separates those concerns without changing enforcement behavior.

  • Focused modules
    • 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.
  • Preserved contracts
    • Staging, ownership tracking, bounded retries, unmount, and rollback remain in StagedHostMountTree.
    • Compatibility re-exports leave existing callers unchanged.
  • Focused coverage
    • Direct module tests cover path boundaries, escaped and stacked mount records, and fail-closed verification.

@lpcox lpcox changed the title [WIP] Refactor mount-tree.ts into focused modules Separate Cloud Hypervisor mount-tree staging from verification and utilities Nov 14, 2026
@lpcox
lpcox marked this pull request as ready for review November 14, 2026 19:52
Copilot AI adaptive review requested due to automatic review settings November 14, 2026 19:52

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 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)

@github-actions

Copy link
Copy Markdown
Contributor

✅ Copilot review passed with no inline comments.

@lpcox Add the ready-for-aw label to this PR to trigger agentic CI smoke tests.

@lpcox
lpcox merged commit 8a87b70 into main Nov 14, 2026
47 of 50 checks passed
@lpcox
lpcox deleted the copilot/refactor-mount-tree-module branch November 14, 2026 20:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Refactoring] Split src/cloud-hypervisor/mount-tree.ts into focused modules

3 participants