Repository navigation
openvmm: pin the discard of FUSE_INIT negotiations whose reply fails - #2060
Merged
Pedro Henrique Penna (ppenna) merged 2 commits intoNov 23, 2026
Merged
Conversation
OpenVMM's FUSE session negotiated FUSE_INIT in its own SessionInfo and marked itself initialized only once it sent the reply (#1898). A reply that could not be sent, as when a guest's reply buffers cannot hold it, thus left the values of a negotiation that the guest never received in an uninitialized session: its saved state was one that SessionState::validate refuses, which a dormant microVM slot refused to save, and the next FUSE_INIT inherited the failed attempt's max_background and congestion_threshold. Pin microsoft/openvmm b73db66767b9f57621c87a69b80f0a9e4e0fd9fa, one commit on feature/microvm/dev 899dcd63f: - fuse: adopt a FUSE_INIT negotiation only once its reply is sent. dispatch_init negotiates in a SessionInfo of the request's own, from the defaults and the guest's offer alone, and stores it in the session, and marks the session initialized, only once the reply is sent, so a reply that fails leaves the session uninitialized without a negotiation. Fuse::init documents it. Its tests pass with the fix; without it, the session saves the failed attempt's values, and the next FUSE_INIT replies its background limits, on Windows. The reply to each NVX guest's mount is sent, so NVX's guests negotiate, mount, and restore as before. 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>
…he OpenVMM roadmap Map position 356, the commit of microsoft/openvmm#5248, which NVX now pins at b73db6676, 230 commits past the mapped tip: - 356, fuse: adopt a FUSE_INIT negotiation only once its reply is sent. Session::dispatch_init negotiates in a SessionInfo of the request's own, from the defaults and the guest's offer alone, and stores it in the session, and marks the session initialized, only once the reply is sent. It negotiated in the session's own SessionInfo, so a reply that could not be sent left the values of a negotiation that the guest never received in an uninitialized session, whose saved state SessionState::validate refuses, and the next FUSE_INIT inherited the failed attempt's max_background and congestion_threshold. Position 356 is not yet assigned to a PR. It changes dispatch_init in session.rs, in lines that PR13's position 047 and position 328 also change, documents the adoption on Fuse::init in lib.rs after position 328's paragraph, and adds two tests to position 328's tests of FUSE_INIT, which use the harness of positions 321 and 325 and PR13's session state. It is no PR13 fixup, although the failed attempt's values reached position 047's saved state: the in-place negotiation is upstream's, and the commit changes lines that position 328 adds, so it follows position 328. Upstream main, b50d0c979, negotiates in place too, so its next FUSE_INIT after a failed reply inherits the same two fields, but it saves no session state; replaying the commit there conflicts in lib.rs, session.rs, and position 328's init.rs, so it cannot go upstream on its 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 remain for the roadmap pin update documenting the FUSE_INIT negotiation-state fix.
No open issues 🎉
What changed in this PR
Pins OpenVMM’s fix for #1898 so FUSE_INIT negotiation state is adopted only after the reply is sent. This prevents failed replies from leaving stale session values or affecting later initialization attempts.
Changes:
- Updates the roadmap’s pin to
b73db6676, adds chain position 356, and adjusts commit counts. - Documents the fix’s behavior, dependencies, and unchanged saved-state format.
- Clarifies that filesystem cleanup after failed initialization remains deferred to #1900.
| File | Description |
|---|---|
doc/openvmm-upstream-roadmap.md |
Maps the new pin and explains its negotiation-state fix, upstream dependencies, and remaining cleanup limitation. |
Review effort: Balanced
5 tasks done
Pedro Henrique Penna (ppenna)
deleted the
agents/issue-1898-init-reply-failure
branch
November 23, 2026 21:42
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 #1898
What does this pull request change?
It pins microsoft/openvmm#5248, which makes OpenVMM's
fuse::Sessionadopt aFUSE_INITnegotiation, and mark itself initialized, only once it has sent the negotiation's reply.Session::dispatch_initnegotiated in the session's ownSessionInfo, through the write guard that it holds for the whole request, so when the reply could not be sent, the session stayed uninitialized but kept the values of a negotiation that the guest never received. It now negotiates in aSessionInfoof the request's own, built from the defaults and the guest's offer alone, and stores it in the session, and marks the session initialized, only after the reply is sent. A reply that cannot be sent leaves the session uninitialized with the defaultSessionInfo, soSession::save_state()saves the default state, and the nextFUSE_INITnegotiates as on a new session. AFUSE_INITwhose negotiation's reply is sent negotiates, replies, and saves exactly as before, so NVX's guests, whose mounts receive that reply, negotiate, mount, and restore as before.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 discard of FUSE_INIT negotiations whose reply failsmoves the gitlink from899dcd63ftob73db66767b9f57621c87a69b80f0a9e4e0fd9fa, the head of [DO NOT REVIEW] fuse: adopt a FUSE_INIT negotiation only once its reply is sent openvmm#5248, and changes nothing else. The protocol vectors and CPU profiles thatnvxcopies are unchanged.doc: map the discard of FUSE_INIT negotiations whose reply fails in the OpenVMM roadmapmaps the new chain position, 356.Start with
dispatch_initin microsoft/openvmm#5248'svm/devices/support/fs/fuse/src/session.rs, then its two tests at the end ofsrc/session/tests/init.rs.Left out: when the reply cannot be sent, the file system's
Fuse::inithas already run, and the session does not pair it withFuse::destroy. #1900 defines that cleanup for aninitthat the session does not complete, and stacks on this change. Until then,VirtioFs::init, which records its negotiation wheninitruns, keeps that record after a failed reply, so a microVM save in that state still fails with "FUSE session and filesystem negotiation state disagree", as it did before this change. No NVX documentation describes this failure path:doc/design/3.6-host-filesystem.mdsays that every other request fails untilINITsucceeds, which still holds, so no NVX documentation changes.Why is this change needed?
The guest decides whether the reply to its
FUSE_INITcan be sent: a virtio-fs reply fails when the guest's writable descriptors cannot hold it, wherewrite_allfails withWriteZero, or lie outside guest memory. After such a failure, the uninitialized session kept the attempt's values:Session::save_state()saved them withinitialized: false, a state thatSessionState::validate()refuses asUninitializedWithInfo, so such a save could not be restored, and a dormant microVM slot, whose save requires the default session state, refused to save at all.FUSE_INITreset only the fields thatdispatch_initsets beforeFuse::init, so the failed attempt'smax_backgroundandcongestion_thresholdreached the file system'sinit, the reply, and the saved state of the next negotiation.The negotiation in place is upstream OpenVMM's: upstream main,
b50d0c979, negotiates the same way, so its nextFUSE_INITafter a failed reply inherits the same two fields, but it saves no session state. The saved state, and the validation that refuses an uninitialized state with values, come from the chain's position 047,fuse: save and restore negotiated session state.Rejected: resetting the session's
SessionInfoafter a failed send, as microsoft/openvmm#5200 did for its refusal of unoffered flags, which would fix this path but leave every early return ofdispatch_initto remember the reset; negotiating in a value of the request's own leaves the session untouched on every path but the one that publishes the negotiation, and the nextFUSE_INITstarts from the defaults by construction.How was this change validated?
Checks and results:
OpenVMM, with Rust 1.97.1,
cargo nextest run --profile agent -p fuseon Windows 11, local, with the fix reverted (session.rsandlib.rsof899dcd63f, with the new tests) and with it:init_whose_reply_fails_leaves_no_negotiationsavesSessionState { initialized: false, info: SessionInfoState { major: 7, minor: 39, max_readahead: 131072, capable: 1073774593, capable2: 16, want: 1073774593, want2: 0, max_background: 64, congestion_threshold: 48, max_write: 1048576, time_gran: 1 } }instead of the default;init_after_a_failed_reply_negotiates_afreshreplies background limits(64, 48)instead of(0, 0)At the pin, on Windows,
cargo check,cargo clippy --all-targets, andcargo doc --no-depsforfuseare clean, apart from theLNK4199linker message that every linked artifact gets on this machine;cargo xtask fmt --fixchanges nothing; andcargo nextest run --profile agent -p virtiofspasses, 230 pass and 3 skipped.python scripts/local_gates.py --base origin/dev --only test-changes markdown-links test-layout openvmm-vectors openvmm-cpu-profiles --runon Windows: all five pass.python scripts/openvmm_pin.py check-branch --topic, againstffac3e840b2, this branch's base ondev, andpython scripts/openvmm_pin.py check-roadmap --worktreepass;python scripts/openvmm_pin.py source b73db66767b9f57621c87a69b80f0a9e4e0fd9fa --pr 5248reports a good signature and the pull request's head;python scripts/nvx.py verifyandpython scripts/check_markdown_links.pypass.A review of the OpenVMM commit found nothing; a review of this branch's whole diff,
git diff --submodule=diff origin/dev HEAD, found two wordings, which are folded in: the roadmap now tells the refusal of unoffered flags, which replies with an error, from a reply that fails, and the pin's message says that no saved-state format changes.Runtime: none of the shared test hosts, for KVM, MSHV, or WHP, accepted an SSH connection while this was open, since their VPN was down, so the microVM scenarios ran only in CI, at this head. Run 45262613381 built OpenVMM at
b73db66767b9f57621c87a69b80f0a9e4e0fd9faand passed every job, among them the microVM tests on KVM, MSHV, and WHP, whosefilesystem-snapshotandplatform-filesystemscenarios, among others, mount virtio-fs shares, and so negotiateFUSE_INITthrough the changeddispatch_init, on each backend.OpenVMM's CI of the pin: microsoft/openvmm run 45253075643, at
b73db66767b9f57621c87a69b80f0a9e4e0fd9fa, 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]. Itsx64-windows-amd-snpandx64-windows-intel-tdxVMM 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. 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, which no reachable host could run; run 45262613381 passed them at this head.
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
899dcd63f, the head offeature/microvm/dev:b73db6676fuse: adopt a FUSE_INIT negotiation only once its reply is sent.b73db66767b9f57621c87a69b80f0a9e4e0fd9fa, the pull request's exact head, with a good signature.feature/microvm/devat899dcd63f, NVX's previous pin, which holds position 328, [DO NOT REVIEW] fuse: fail FUSE_INIT when init wants flags the client did not offer openvmm#5200 (openvmm: fuse: dispatch_init asserts on unoffered Fuse::init flags and trusts mutable SessionInfo capabilities #1630), whose lines ofdispatch_initand tests ofFUSE_INITthis commit changes and extends, the session's test harness of positions 321 and 325, and the session state of position 047.b50d0c979: replaying it there conflicts inlib.rsandsession.rs, whose lines of positions 047 and 328 it changes, and in position 328'sinit.rs, which upstream main lacks. The pin is 230 commits past the mapped tip.b73db6676, and so does the fix of openvmm: FUSE file-system setup has no cleanup callback after a refused INIT #1900, which completes the cleanup that this change leaves out.feature/microvm/devtob73db66767b9f57621c87a69b80f0a9e4e0fd9fa(OpenVMM's merge button squashes, which would leave the pin off the branch); then merge this pull request.