Repository navigation
microVM: accept host paths with commas in --mount - #131
Merged
Merged
Conversation
There was a problem hiding this comment.
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Copilot review overview
2 open findings
What changed in this PR
Enables --mount to accept host paths containing commas by parsing the guest target up to the first comma and the mode after the last comma, aligning behavior with --mount-child.
Changes:
- Updated
--mountparsing to use first-comma / last-comma splitting and improved error text for invalid modes in comma-containing paths. - Added unit/integration tests covering comma-containing host paths and edge cases.
- Updated CLI and virtio-fs guide documentation to describe the new parsing rule.
| File | Description |
|---|---|
| openvmm/openvmm_entry/src/microvm/filesystem.rs | Adds a resolver-style test ensuring mounts and denied paths resolve to the intended comma-named directories. |
| openvmm/openvmm_entry/src/cli_args/microvm.rs | Updates --mount parsing to support commas in host paths; adds parsing tests and updates CLI help text. |
| Guide/src/reference/openvmm/management/cli.md | Documents the first-comma / last-comma parsing rule for --mount. |
| Guide/src/reference/devices/virtio/virtio-fs.md | Documents the first-comma / last-comma parsing rule for virtio-fs --mount. |
🧠 Review effort: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
ppenna
added a commit
to microsoft/nvx
that referenced
this pull request
Oct 11, 2026
71a528668 (fix/microvm-mount-host-path-commas-283 in nanvix/openvmm, nanvix/openvmm#131) stacks on 2130f24b5, which dev already pins. It lets --mount GUEST_TARGET,HOST_PATH[,ro|rw] share a host directory whose path contains commas, such as C:\projects\alpha,beta or C:\reports\2026, final. The guest target ends at the first comma, and with another comma, the mode follows the last one, so a host path may contain commas when the mode is given, as --mount-child already allowed. A value with one comma still shares its host path read-only, and one with two still needs a valid mode, so every value that OpenVMM accepted keeps its meaning. A value with more commas, which OpenVMM rejected, now shares the host path between its first and last commas if it ends in ro or rw. The error for another mode suggests ending the value with ,ro or ,rw if the host path contains commas. --mount-child, snapshots, and saved state are unchanged. run and sandbox still reject host paths with commas; a following commit accepts them. Part of #283. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Part of microsoft/nvx#283. --mount GUEST_TARGET,HOST_PATH[,ro|rw] split its value at its first two commas, so a host path that contains a comma, such as C:\projects\alpha,beta or C:\reports\2026, final, lost its tail to the mode, which OpenVMM then rejected. --mount-child already reads its mode after the last comma, so its host paths may contain commas. Parse --mount the same way: the guest target ends at the first comma, and with another comma, the mode follows the last one, so a host path may contain commas when the mode is given. A value with one comma still shares its host path read-only, and one with two still needs a valid mode, so every value that OpenVMM accepted keeps its meaning, and so does every value with fewer than three commas that it rejected. A value with more commas, which OpenVMM rejected, now shares the host path between its first and last commas if it ends in ro or rw. The error for an invalid mode now says that a host path with commas requires the mode. Add command-line tests for host paths with commas, with a trailing comma, and ending in what looks like a mode, and a resolver test that --mount and --mount-child share the exact comma-named directories with their modes and denied paths. Update the command-line help and the Guide's virtio-fs and CLI pages. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Part of microsoft/nvx#283. Address review feedback: the error for an invalid --mount mode said that a host path that contains commas requires the mode, even for a value such as /mnt/share,host,write, whose host path has none, which read as the cause of the error. State the hint as a condition instead: if HOST_PATH contains commas, end the value with ,ro or ,rw. A test checks the error's mode and hint. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
ppenna
force-pushed
the
fix/microvm-mount-host-path-commas-283
branch
from
October 13, 2026 00:06
71a5286 to
1feb1f4
Compare
ppenna
added a commit
to microsoft/nvx
that referenced
this pull request
Oct 13, 2026
1feb1f4a3 (fix/microvm-mount-host-path-commas-283 in nanvix/openvmm, nanvix/openvmm#131) stacks on a5955855c, which dev already pins. It lets --mount GUEST_TARGET,HOST_PATH[,ro|rw] share a host directory whose path contains commas, such as C:\projects\alpha,beta or C:\reports\2026, final. The guest target ends at the first comma, and with another comma, the mode follows the last one, so a host path may contain commas when the mode is given, as --mount-child already allowed. A value with one comma still shares its host path read-only, and one with two still needs a valid mode, so every value that OpenVMM accepted keeps its meaning. A value with more commas, which OpenVMM rejected, now shares the host path between its first and last commas if it ends in ro or rw. The error for another mode suggests ending the value with ,ro or ,rw if the host path contains commas. --mount-child, snapshots, and saved state are unchanged. run and sandbox still reject host paths with commas; a following commit accepts them. Part of #283. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
ppenna
added a commit
to microsoft/nvx
that referenced
this pull request
Oct 13, 2026
1feb1f4a3 (fix/microvm-mount-host-path-commas-283 in nanvix/openvmm, nanvix/openvmm#131) stacks on a5955855c, which dev already pins. It lets --mount GUEST_TARGET,HOST_PATH[,ro|rw] share a host directory whose path contains commas, such as C:\projects\alpha,beta or C:\reports\2026, final. The guest target ends at the first comma, and with another comma, the mode follows the last one, so a host path may contain commas when the mode is given, as --mount-child already allowed. A value with one comma still shares its host path read-only, and one with two still needs a valid mode, so every value that OpenVMM accepted keeps its meaning. A value with more commas, which OpenVMM rejected, now shares the host path between its first and last commas if it ends in ro or rw. The error for another mode suggests ending the value with ,ro or ,rw if the host path contains commas. --mount-child, snapshots, and saved state are unchanged. run and sandbox still reject host paths with commas; a following commit accepts them. Part of #283. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.


This PR lets
--mountshare a host directory whose path contains commas, for microsoft/nvx#283.Why
--mount GUEST_TARGET,HOST_PATH[,ro|rw]split its value at its first two commas, so a host path with a comma, such asC:\projects\alpha,betaorC:\reports\2026, final, lost its tail to the mode, which OpenVMM then rejected. Such paths are valid on Windows and Linux, and MXC'sfilesystem.readonlyPathsandfilesystem.readwritePathsaccept them.--mount-childalready reads its mode after the last comma, so only--mountrefused them.Changes
--mountreads the guest target up to the first comma and, with another comma, the mode after the last one, soHOST_PATHmay contain commas when the mode is given, as with--mount-child. A value with more than one comma must end inroorrw. The error for another mode suggests ending the value with,roor,rwifHOST_PATHcontains commas.--mountand--mount-childshare the exact comma-named directories,alpha,betaand2026, final, with their modes and denied paths, rather than the siblingalphathat the text before the last comma names.5a7aad12c1feb1f4a3Compatibility
Every
--mountvalue that OpenVMM accepted keeps its meaning: with one comma, the host path is shared read-only, and with two, the value still needs a valid mode, so/mnt/share,host,writeis still rejected. Only values with three or more commas, which OpenVMM rejected, are newly accepted, and only when they end inroorrw.--mount-child, snapshots, and saved state are unchanged: snapshots already record canonical host paths as strings.Validation
The branch sits on
mainata5955855c. All results below are for this head,1feb1f4a3. Its commits are the earlierf62a1126cand71a528668rebased onto thatmain:git range-diffpairs each with its original as identical, and the diffs differ only in theindexline of the Guide's virtio-fs page, whose base now includes #132's row.On Windows,
cargo clippy --all-targets,cargo doc --no-deps, andcargo nextest run --profile agentforopenvmm_entry: clean, with 197 tests passed.cargo xtask fmtreports no changes.On Linux (prometheus30, bare metal, Azure Linux 3.0), the same nextest run for
openvmm_entry: 230 passed.filesystem: share host paths that contain commas microsoft/nvx#494, which pins this head, passed on bare-metal Linux/MSHV (prometheus30), Linux/KVM (prometheus32), and Windows/WHP (prometheus28), with OpenVMM built from this head:
filesystem-comma-paths,filesystem-shares,filesystem-policy,denied-filesystem-paths, andfilesystem-snapshotscenarios oftest-microvm.filesystem-comma-pathsshares a read-writealpha,betaand a read-only2026, finaldirectory throughnvx.py run, each alone, as--mount, and both, as--mount-childchildren. It requires the exact directories, their modes, which hold even after guest root remounts the read-only share read-write, and their hidden denied subdirectories;aci_edge_sandboxeslifecycle tests, 16 of 16.Before the rebase, at
71a528668, it also passed the sandbox share smoke tests with the same two directories, one-shot alone and together, and managed.The NVX CI covers KVM, MSHV, and WHP. Merge this PR before microsoft/nvx#494.