Repository navigation
openvmm: pin the virtio-fs saves that refuse replaced objects - #2068
Merged
Pedro Henrique Penna (ppenna) merged 3 commits intoNov 24, 2026
Merged
Conversation
OpenVMM's microVM virtio-fs save recorded each node with the identity of whatever object its first name reached at the save, and checked only that the node's names agreed with each other (#1901). Once host software had renamed a new file over a file that the guest held open, the save thus recorded the held node with the new file's identity under the held file's guest inode number, and the snapshot failed to restore: with "saved aliases are duplicated or ambiguous" once the guest had looked the name up again, and with "saved guest inode ID does not match the attachment" without that lookup. Pin microsoft/openvmm 5e0e72d72d60bce5e2c5735a08ffebd57ae24216, three commits on 09966aa63, the head of microsoft/openvmm#5253, which NVX pins below this commit: - virtiofs: fail a microVM save while the guest holds a replaced object. The save records each node's own identity, the device, inode number, and file type of the object that the node got, and fails when a name of the node reaches another object, with an error that says that the guest must release the object. - virtiofs: fail a microVM save of nodes or handles that a restore rejects. The save also fails when two nodes of one volume share a name or the key of one object, or when a handle reaches another object than its node, which a restore rejects too. - virtiofs: say which nodes a microVM save keeps apart. The comments of the second commit's checks now say that they keep apart only the nodes of one volume, and how two nodes of one object arise. Their tests pass with the fixes; without them, the saves succeed, on Windows. A capture now fails, instead of saving a snapshot that cannot restore, while the guest holds such an object, and succeeds again once the guest releases it, as a Linux guest does when it closes the file. No other capture changes, and the restore is unchanged. No saved-state, protocol, or ABI format, and no version of any of them, changes. The protocol vectors and CPU profiles that nvx copies are unchanged. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Capture of a microVM's virtio-fs state now checks each name and handle of a node against the node's own object, by the device, inode number, and file type that a restore requires, and that no two nodes of one volume share a name or an object (#1901). It thus fails while the guest holds an object that the host has replaced, as after host software renamed a new file over a file that the guest holds open, rather than save a snapshot that cannot restore, and succeeds again once the guest stops using the object. Step 3 of 3.6.8 said only that capture checks that all names of a node reach one object. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…VMM roadmap Map positions 362-364, the commits of microsoft/openvmm#5254, which NVX now pins at 5e0e72d72, 238 commits past the mapped tip: - 362, virtiofs: fail a microVM save while the guest holds a replaced object. The save records each node's own identity, the device, inode number, and file type of the object that the node got, and checks every name of the node against it, as the restore does. It took the identity from the object that the node's first name reached, so once host software had renamed a new file over a file that the guest held open, it saved a snapshot that failed to restore. - 363, virtiofs: fail a microVM save of nodes or handles that a restore rejects. The save also fails when two nodes of one volume share a name or a dedup key, or when a handle reaches another object than its node, which the restore rejects too. - 364, virtiofs: say which nodes a microVM save keeps apart. Two comments of position 363's checks now say that they keep apart only the nodes of one volume, and how two nodes of one object arise. Positions 362-364 are not yet assigned to a PR. They change the node and handle loops of save_microvm_state, in lines that PR18's position 083 adds, remove position 083's validate_saved_identity, add VirtioFsInode::object_identity after position 083's from_saved, and add three tests after position 083's test of hard link aliases, which call the policy tests' helpers that position 160 adds and position 164 exports. They fix defects of position 083's save, but position 362 compares by the device that position 329 records, through position 330's device_nr, and their tests need position 164's export, so they are no PR18 fixups, and they follow position 330. Upstream main, 5d6ab1cfa, lacks the microVM's snapshots; replaying the commits there conflicts in the microVM's files and in the Guide's virtio-fs page, which it lacks, so they cannot go upstream on their own. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues were identified for the OpenVMM pin and capture-check documentation updates.
No open issues 🎉
What changed in this PR
Pins the OpenVMM fix for #1901 so virtio-fs capture rejects snapshots that cannot safely restore after the host replaces a guest-referenced object, without changing the snapshot format.
Changes:
- Documents capture checks against each node’s identity, including handle mismatches and duplicate names or objects within a volume.
- Updates the OpenVMM roadmap to pin
5e0e72d72and map positions 362–364, including their dependencies.
| File | Description |
|---|---|
doc/openvmm-upstream-roadmap.md |
Updates the pin, chain counts, and mapping for the three OpenVMM commits. |
doc/design/3.6-host-filesystem.md |
Explains capture rejection conditions and when releasing guest references permits capture again. |
Review effort: Balanced
This was referenced Nov 24, 2026
Pedro Henrique Penna (ppenna)
deleted the
agents/issue-1901-snapshot-replaced-path
branch
November 24, 2026 03:45
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.
Fixes #1901
What does this pull request change?
It pins microsoft/openvmm#5254, which makes OpenVMM's microVM virtio-fs save,
VirtioFs::save_microvm_state, refuse a snapshot that cannot restore when the host has replaced an object that the guest holds, instead of saving it. The save took the identity that it records for a node from whatever object the node's first name reached at the save, and checked only that the node's other names agreed with each other. When host software renamed a new file over a file that the guest held open, the save recorded the held node with the new file's identity under the held file's guest inode number, and, once the guest had looked the name up again, both nodes under the same name: the restore then failed with "saved aliases are duplicated or ambiguous", or, without that lookup, with "saved guest inode ID does not match the attachment".The save now records each node's own identity, the device, inode number, and file type of the object that the node got, and checks every name and handle of the node against it, as a restore does, and it refuses two nodes of one volume that share a name or one object, as a restore does. Each refusal is an actionable error that names the node or handle and says what the guest must release; the held object has no name left by which a restore could reopen it, and a snapshot records nothing else, so no save can keep it. Once the guest releases it, as a Linux guest does when it closes the file, since the microVM profile's entry timeout is zero, the save succeeds, and its restore binds the name to the new object. The guest's handle keeps reading the old file meanwhile, and a restore never binds the old node or handle to the replacement. The restore and the snapshot format are unchanged, and the save refuses only states that the restore rejects, or would restore as an object of another file type.
No version is created or bumped: no ABI, machine-contract, time-ABI, snapshot, manifest, saved-state, or protocol version changes, in NVX or in OpenVMM, and no saved-state, snapshot, or on-disk format changes.
Commits:
openvmm: pin the virtio-fs saves that refuse replaced objectsmoves the gitlink from09966aa63, the head of [DO NOT REVIEW] virtiofs: keep the node that a LINK returns until the guest forgets it openvmm#5253 that the base branch pins, to5e0e72d72d60bce5e2c5735a08ffebd57ae24216, the head of [DO NOT REVIEW] virtiofs: fail a microVM save while the guest holds a replaced object openvmm#5254, and changes nothing else. The protocol vectors and CPU profiles thatnvxcopies are unchanged.doc: describe the virtio-fs capture checks of replaced objectsupdates step 3 of 3.6.8 with the checks that capture now makes.doc: map the virtio-fs saves that refuse replaced objects in the OpenVMM roadmapmaps the new chain positions, 362-364.Start with
save_microvm_statein microsoft/openvmm#5254'svm/devices/virtio/virtiofs/src/microvm/fs.rs, then its three tests insrc/microvm/fs_tests.rs.Left out: a replacement with the device, inode number, and file type of the object that a node holds, as when the host removes a file that the guest holds only through a lookup, with no open handle, and creates one that reuses its inode number, still passes every check, and a restore binds the node to the replacement. The running device already resolves the node to the replacement, since it keys nodes by that identity and nodes hold no host descriptor; telling the two apart would need a host reference per node or a generation number in the snapshot, a format change, which this change avoids. An open handle keeps its object, so its inode number cannot be reused while the guest holds the handle.
Why is this change needed?
A successful save tells the caller that it has a usable checkpoint, and #1901 found, with the scratch test of #1889, a save that succeeded and a snapshot that then failed to restore after the host replaced an object that the guest held. The save's identity check came from the chain's position 083,
virtiofs: persist microVM FUSE namespaces, handles, and directory cookies, which recorded the identity that a node's first name reached, so it could not tell a replaced object from the node's own.Rejected:
How was this change validated?
Checks and results:
OpenVMM, with Rust 1.97.1,
cargo nextest run --profile agent -p virtiofson Windows 11, local, without each fix and with them:09966aa63, the base, with the new tests)b5914cf2d, with the second commit's tests)b2ac1073dand at the pin,5e0e72d72At
899dcd63f, below the stack, a scratch probe that was not committed restored such saves and got: "saved aliases are duplicated or ambiguous" for the held file after a lookup of the new file, the error of openvmm: virtiofs saves a snapshot it cannot restore after the host replaces a referenced path #1901, and for two nodes under one name; "saved guest inode ID does not match the attachment" without that lookup; "saved inode aliases are ambiguous" for two nodes under different names; and "reopened handle identity does not match" for the handle.At each of the three OpenVMM commits, on Windows,
cargo check,cargo clippy --all-targets, andcargo doc --no-depsforvirtiofsare clean, apart from theLNK4199linker message that every linked artifact gets on this machine,cargo nextest run --profile agent -p virtiofspasses (234, 236, and 236 pass, 3 skipped), andcargo xtask fmt --fixchanges nothing. Before the rebase onto [DO NOT REVIEW] virtiofs: keep the node that a LINK returns until the guest forgets it openvmm#5253, the first two commits on899dcd63fpassed the same checks andcargo clippy --all-targets --target x86_64-unknown-linux-gnu -p virtiofs.python scripts/local_gates.py --base origin/agents/issue-1897-link-forget-race --only test-changes markdown-links test-layout openvmm-vectors openvmm-cpu-profiles --runon Windows: all five pass;check_test_changes.pylists no change to an existing test.python scripts/openvmm_pin.py check-branch --topic --target origin/agents/issue-1897-link-forget-raceandpython scripts/openvmm_pin.py check-roadmappass;python scripts/openvmm_pin.py source 5e0e72d72d60bce5e2c5735a08ffebd57ae24216 --pr 5254reports a good signature and the pull request's head;python scripts/nvx.py verifyandpython scripts/check_markdown_links.pypass.Reviews: a review of the OpenVMM commits found two things. The Guide said that closing the file unblocks capture, which needs the guest to release its node too; the Guide's wording is fixed. The same-number replacement is the limit under What does this pull request change?. A review of this branch's whole diff,
git diff --submodule=diff origin/agents/issue-1897-link-forget-race HEAD, also found two things: the checks keep apart only the nodes of one volume, which the third OpenVMM commit and step 3 of 3.6.8 now say, and the roadmap misattributed the policy tests' helpers, which it now attributes to positions 160 and 164.Runtime: none of the shared Linux test hosts, for KVM or MSHV, accepted a TCP connection on their SSH ports while this was open (their VPN was down), so the microVM scenarios ran only in CI, at this head. Run 45290465963 built OpenVMM at
5e0e72d72d60bce5e2c5735a08ffebd57ae24216and passed every job, among them the microVM tests on KVM, MSHV, and WHP, whosefilesystem-snapshotandplatform-filesystemscenarios, among others, capture virtio-fs shares through the changed save. Its first attempt failed only itsOpenVMM CI of the pinned revisionjob, since OpenVMM'srun vmm-tests [x64-linux-amd-kvm]was skipped after the runner ofbuild artifacts (for VMM tests) [aarch64-linux]shut down (exit code 143); that OpenVMM job's one rerun passed, and so did the NVX job's, in attempt 2.OpenVMM's CI of the pin: microsoft/openvmm run 45287652986, at
5e0e72d72d60bce5e2c5735a08ffebd57ae24216, passed the jobs that NVX'sOpenVMM CI of the pinned revisionjob requires,unit tests [x64-linux],unit tests [x64-windows], andrun vmm-testsonx64-linux-amd-kvm,x64-linux-intel-mshv,x64-windows-intel, andx64-windows-amd, and itsquick check [fmt, clippy x64-linux]andxtask fmt (windows). Itsx64-windows-amd-snpVMM tests, which NVX does not require, failed, and with them theopenvmm checkin gatessummary.Backend, host OS, host type, and guest: the unit tests ran on Windows 11, local, and in OpenVMM's CI on Linux and Windows. The microVM scenarios ran in CI only, on Linux KVM, Linux MSHV, and Windows WHP virtual machines, with the Alpine guest, and with the Ubuntu and Azure Linux guests in the guests-and-sandboxes jobs.
Left to CI: the microVM scenarios on every backend and the Linux unit tests, which no reachable host could run; runs 45290465963 and 45287652986 passed them at this head and pin.
Checklist
python3 scripts/check_test_layout.pychecks.python3 scripts/check_test_changes.py --base origin/devlists no changeto an existing test, or a Changes to existing tests section below
explains each one.
.github/copilot-instructions.mdand the skills when a convention orworkflow changes.
nvxupdatesnvx/public-api/withpython3 scripts/public_api.py --update.description says how the change versions or migrates them.
OpenVMM pin
09966aa63, the head of [DO NOT REVIEW] virtiofs: keep the node that a LINK returns until the guest forgets it openvmm#5253:b5914cf2dvirtiofs: fail a microVM save while the guest holds a replaced objectb2ac1073dvirtiofs: fail a microVM save of nodes or handles that a restore rejects5e0e72d72virtiofs: say which nodes a microVM save keeps apart5e0e72d72d60bce5e2c5735a08ffebd57ae24216, the pull request's exact head, with a good signature.feature/microvm/devyet: [DO NOT REVIEW] chipset test harnesses: find offsets in a region that ends at the top openvmm#5252 (openvmm: chipset test and fuzz offset lookups still disagree with production at the address-space boundary #1902) and [DO NOT REVIEW] virtiofs: say that inodes deduplicate only within a volume openvmm#5251 (openvmm: clarify the volume scope of inode deduplication in the insert_inode comment #1905).feature/microvm/devis ate8324ea31since [DO NOT REVIEW] fuse: adopt a FUSE_INIT negotiation only once its reply is sent openvmm#5248 (openvmm: FUSE session retains negotiated values when the INIT reply cannot be sent #1898) and [DO NOT REVIEW] vmotherboard: claim a device's PCI slot only once its unit spawns openvmm#5249 (openvmm: failed PCI device construction leaves the bus slot registered #1904) landed.device_nr, and their tests need position 164's export of the policy tests' helpers, so they follow position 330. They do not apply to upstream main,5d6ab1cfa, which lacks the microVM's files and the Guide's virtio-fs page. The pin is 238 commits past the mapped tip.agents/issue-1897-link-forget-race, which pins [DO NOT REVIEW] virtiofs: keep the node that a LINK returns until the guest forgets it openvmm#5253; only the top three commits belong to this pull request.feature/microvm/devto5e0e72d72d60bce5e2c5735a08ffebd57ae24216after the OpenVMM pull requests below it (OpenVMM's merge button squashes, which would leave the pin off the branch), and merge this pull request only after openvmm: virtiofs LINK can return a node whose registration races with FORGET #1897's.