From bf15295c2403bf1366f643a1cbad0a669da075e5 Mon Sep 17 00:00:00 2001 From: Pedro Henrique Penna Date: Thu, 5 Nov 2026 17:05:56 -0800 Subject: [PATCH 1/2] openvmm: pin the stable code of a port forward that cannot bind A clone's VMM that cannot bind the port of a forward of the clone's network exits before its restore-ready event with a fatal error that carried no code, so the launch attributed it to the host only by the text of a cause of OpenVMM's error chain, which an excerpt of OpenVMM's source, port_forward_socket_creation.rs, pinned (#972). Pin e1ca353eb, which microsoft/openvmm#4951 proposes for feature/microvm/dev: one commit on 6fb64731f, the current head of that branch. The SocketCreation error of the Consomme resolver now leads with the stable code E_PORT_FORWARD_BIND, and so does OpenVMM's fatal error: fatal error: [E_PORT_FORWARD_BIND] failed to launch vm worker The launch already attributes that code to forward-bind. The excerpt is no longer a run of whole lines of resolver.rs, so it goes, with the check of the text against it; the text itself, which attributes the error of an OpenVMM that predates the code, goes in a later change. On nvx-kvm-test (KVM), nvx-mshv-test (MSHV), and nvx-whp-test (WHP), all virtual machines, with release v0.1.0-dev.4cfe8330e719, the platform-network-policy scenario's restore of a forward whose host port another socket holds failed with "fatal error: failed to launch vm worker" with dev's OpenVMM, and with "fatal error: [E_PORT_FORWARD_BIND] failed to launch vm worker" with a local build of e4c5a7461, whose cause that names the forward leads with the code too. e1ca353eb is that commit rebased from 14dc4116e onto 6fb64731f without conflicts: its diff from its parent is e4c5a7461's, byte for byte. The control-session vectors, the remaining source excerpts, the contract versions, and the CPU profiles that nvx-rs copies from OpenVMM match the revision's. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- nvx-rs/src/host/template/clone/failure.rs | 5 ++--- nvx-rs/src/host/template/clone/failure/tests.rs | 8 -------- nvx-rs/tests/openvmm_vectors.rs | 6 +----- nvx-rs/tests/vectors/README.md | 13 +++---------- .../vectors/openvmm/port_forward_socket_creation.rs | 6 ------ openvmm | 2 +- 6 files changed, 7 insertions(+), 33 deletions(-) delete mode 100644 nvx-rs/tests/vectors/openvmm/port_forward_socket_creation.rs diff --git a/nvx-rs/src/host/template/clone/failure.rs b/nvx-rs/src/host/template/clone/failure.rs index 70bdf3ec9..1617d0121 100644 --- a/nvx-rs/src/host/template/clone/failure.rs +++ b/nvx-rs/src/host/template/clone/failure.rs @@ -906,9 +906,8 @@ pub(super) const FORWARD_BIND_CODE: &str = "E_PORT_FORWARD_BIND"; /// The text with which a cause of OpenVMM's fatal error names a forward of a clone's network whose /// port of host loopback OpenVMM cannot bind as it restores the clone's NIC: the forward's -/// protocol, `Tcp` or `Udp`, its address, and its port follow, then `)`, as the excerpt of -/// OpenVMM's source `tests/vectors/openvmm/port_forward_socket_creation.rs` spells the error. -/// An OpenVMM that predates [`FORWARD_BIND_CODE`] gives the error no code. +/// protocol, `Tcp` or `Udp`, its address, and its port follow, then `)`, as an OpenVMM that +/// predates [`FORWARD_BIND_CODE`] spells the error, without a code. pub(super) const FORWARD_BIND_TEXT: &str = "failed to create socket for port forward ("; /// Returns the code in brackets with which `text` starts, as OpenVMM leads an error, and the line diff --git a/nvx-rs/src/host/template/clone/failure/tests.rs b/nvx-rs/src/host/template/clone/failure/tests.rs index a4e99d36a..b4a6b9d40 100644 --- a/nvx-rs/src/host/template/clone/failure/tests.rs +++ b/nvx-rs/src/host/template/clone/failure/tests.rs @@ -335,14 +335,6 @@ fn openvmm_s_fatal_error_is_evidence_of_an_incompatible_host_only_for_its_codes( #[test] fn openvmm_s_fatal_error_is_evidence_of_a_forward_bind_when_it_names_a_forward_it_cannot_bind() { - // OpenVMM spells the error as its source, which the excerpt copies, writes it. - let excerpt = - include_str!("../../../../../tests/vectors/openvmm/port_forward_socket_creation.rs"); - let attribute = format!("#[error(\"{FORWARD_BIND_TEXT}{{details}})\")]"); - assert!( - excerpt.lines().any(|line| line.trim() == attribute), - "{attribute} in {excerpt}" - ); // The cause of the chain follows the line that leads the error, or is the line's own. for line in [ "fatal error: failed to launch vm worker: failed to create socket for port forward \ diff --git a/nvx-rs/tests/openvmm_vectors.rs b/nvx-rs/tests/openvmm_vectors.rs index 803910b40..ee254c512 100644 --- a/nvx-rs/tests/openvmm_vectors.rs +++ b/nvx-rs/tests/openvmm_vectors.rs @@ -21,7 +21,7 @@ const FILES: [&str; 2] = [ /// The excerpts of OpenVMM's sources that `tests/vectors/openvmm/` copies: for each, its file /// there, and the file of the OpenVMM submodule whose lines it copies, unchanged. -const EXCERPTS: [(&str, &str); 3] = [ +const EXCERPTS: [(&str, &str); 2] = [ ( "microvm_control_tty_command_line.rs", "openvmm/openvmm_defs/src/microvm.rs", @@ -30,10 +30,6 @@ const EXCERPTS: [(&str, &str); 3] = [ "platform_command_line_token_is_invariant.rs", "openvmm/openvmm_helpers/src/snapshot/microvm.rs", ), - ( - "port_forward_socket_creation.rs", - "vm/devices/net/net_consomme/src/resolver.rs", - ), ]; /// The versions of `nvx::contract` that are OpenVMM's: for each, the file of the OpenVMM diff --git a/nvx-rs/tests/vectors/README.md b/nvx-rs/tests/vectors/README.md index 08f8a646d..8bc07a854 100644 --- a/nvx-rs/tests/vectors/README.md +++ b/nvx-rs/tests/vectors/README.md @@ -13,7 +13,7 @@ yet breaks those peers. Only bytes that no codec produced catch such a change. | [`nvxl-v1.txt`](nvxl-v1.txt) | Version 1 of the `NVXL` listener announcement | | [`activation-v1.txt`](activation-v1.txt) | Version 1 of the activation record of a layered root, and what Ready reports about an activation | | [`template-key-v1.txt`](template-key-v1.txt) | Version 1 of the canonical encodings of a template's compatibility key and of a capture class, with their identities | -| [`openvmm/`](openvmm) | OpenVMM's vectors and cases of the `NVXS` session, and the excerpts of its sources that define the kernel command-line tokens of its platform tier and the error of a port forward that it cannot bind, unchanged | +| [`openvmm/`](openvmm) | OpenVMM's vectors and cases of the `NVXS` session, and the excerpts of its sources that define the kernel command-line tokens of its platform tier, unchanged | [4.4 Host-Guest Control Interface](../../../doc/design/4.4-host-guest-control-interface.md) and @@ -88,7 +88,7 @@ refusals of the records' payloads and headers. The tests of `nvx::protocol::nvxs` check that each vector decodes and encodes to its bytes, and that each case is accepted or refused as it says. -`openvmm/` also holds three excerpts of OpenVMM's sources at that commit, whole +`openvmm/` also holds two excerpts of OpenVMM's sources at that commit, whole lines, unchanged: `platform_command_line_token_is_invariant.rs`, the function of `openvmm/openvmm_helpers/src/snapshot/microvm.rs` that admits the kernel command-line tokens of a capture at OpenVMM's platform tier, and @@ -98,14 +98,7 @@ the function reads. The tests of `nvx::host::template` compile them, and check each token of a template's kernel command line with OpenVMM's own function. The runtime adapter in `tests/runtime-adapter/` compiles them too, as the allowlist with which the guest agent of a template's VM checks its kernel command line, -and its tests pin the set of tokens that they admit. The third, -`port_forward_socket_creation.rs`, is the variant of the error of -`vm/devices/net/net_consomme/src/resolver.rs` with which OpenVMM reports a port -forward whose socket on the host it cannot bind, as when a clone's VMM restores -its NIC with a forward whose port another socket holds. OpenVMM gives that -error no code, so the launch of a clone attributes it to the host by its text, -and the tests of `nvx::host::template` read the excerpt, and check that the -text is OpenVMM's. +and its tests pin the set of tokens that they admit. The tests cannot call OpenVMM's broker or its allowlist: OpenVMM's workspace needs a later Rust release than `nvx`'s minimum, and the `nvx-rs` job cannot diff --git a/nvx-rs/tests/vectors/openvmm/port_forward_socket_creation.rs b/nvx-rs/tests/vectors/openvmm/port_forward_socket_creation.rs deleted file mode 100644 index 9262a8d00..000000000 --- a/nvx-rs/tests/vectors/openvmm/port_forward_socket_creation.rs +++ /dev/null @@ -1,6 +0,0 @@ - #[error("failed to create socket for port forward ({details})")] - SocketCreation { - #[source] - source: std::io::Error, - details: String, - }, diff --git a/openvmm b/openvmm index 6fb64731f..e1ca353eb 160000 --- a/openvmm +++ b/openvmm @@ -1 +1 @@ -Subproject commit 6fb64731f03314a3c5ee634d3c85d6782a5babe0 +Subproject commit e1ca353eb23c43d38b52e9b5156252fc4c7fc62d From 61dd8a6100605c701a206e02d642c33fc476337c Mon Sep 17 00:00:00 2001 From: Pedro Henrique Penna Date: Thu, 5 Nov 2026 17:09:08 -0800 Subject: [PATCH 2/2] doc: map the port forward bind code in the OpenVMM roadmap The NVX pin moves to e1ca353eb, position 220, 85 commits past the mapped tip. Position 220, which microsoft/openvmm#4951 proposes for feature/microvm/dev on its head, 6fb64731f, where microsoft/openvmm#4952 landed positions 217-219 by fast-forward, is unassigned: it leads the error with which the Consomme resolver reports a port forward that it cannot bind with the stable code E_PORT_FORWARD_BIND, which OpenVMM's fatal error then leads with. The roadmap's account of microsoft/openvmm#4952 now says that it landed. Position 220 changes nothing that a mapped PR adds: the error is upstream's, and the fatal error's helper and the Guide's sentences that it changes come from positions 143, 151, 179, 183, and 186. Replaying it on upstream main conflicts in all four of its files, one of which, position 143's verification module, upstream main lacks. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- doc/openvmm-upstream-roadmap.md | 37 +++++++++++++++++++++------------ 1 file changed, 24 insertions(+), 13 deletions(-) diff --git a/doc/openvmm-upstream-roadmap.md b/doc/openvmm-upstream-roadmap.md index c82a95740..739966bb5 100644 --- a/doc/openvmm-upstream-roadmap.md +++ b/doc/openvmm-upstream-roadmap.md @@ -8,20 +8,20 @@ - Mapped fork tip: `3cdf4fe3834cfb90b9ee685875493bc9bff1b7a4`, position 135. The graph, PR summary, and commit mapping below cover positions 001-135, the PR20 fixup at position 152, PR06's read fix at position 217, and the PR13 fixups at positions 218 and 219. -- NVX's pinned OpenVMM revision: `6fb64731f03314a3c5ee634d3c85d6782a5babe0`, position 219. Positions - 217-219, which microsoft/openvmm#4952 proposes for `feature/microvm/dev`, are three commits on - position 216, `14dc4116e`, the head of `feature/microvm/dev`. microsoft/openvmm#4921 landed - positions 215 and 216 there by fast-forward, as microsoft/openvmm#4916 landed position 214, and - microsoft/openvmm#4894, microsoft/openvmm#4886, and microsoft/openvmm#4887 landed positions - 211-213 on position 210, `eda13d80a`, the head of the `feature/microvm/release/v4.0` branch of - microsoft/openvmm. The v4.0 reorganization moved the 205 +- NVX's pinned OpenVMM revision: `e1ca353eb23c43d38b52e9b5156252fc4c7fc62d`, position 220. Position + 220, which microsoft/openvmm#4951 proposes for `feature/microvm/dev`, is one commit on position + 219, `6fb64731f`, the head of `feature/microvm/dev`. microsoft/openvmm#4952 landed positions + 217-219 there by fast-forward, as microsoft/openvmm#4921 landed positions 215 and 216, + microsoft/openvmm#4916 position 214, and microsoft/openvmm#4894, microsoft/openvmm#4886, and + microsoft/openvmm#4887 positions 211-213 on position 210, `eda13d80a`, the head of the + `feature/microvm/release/v4.0` branch of microsoft/openvmm. The v4.0 reorganization moved the 205 commits of `feature/microvm/release/v3.0` and the NVX pin before it, `35e76265f`, onto `c6d3da0ff`. It dropped the eight commits whose changes upstream had landed or superseded, retired the fallible device start that microsoft/nvx#1232 replaces with awaited device restoration, folded that restoration into the commits that it changes, and added 14 commits that give each ABI that the chain introduces a single version; see [The v4.0 reorganization](#the-v40-reorganization). The - pin is 84 commits past the mapped tip on the same first-parent chain. Positions 136-216, except - the PR20 fixup at position 152, are not yet assigned to PRs; see + pin is 85 commits past the mapped tip on the same first-parent chain. Positions 136-216 and 220, + except the PR20 fixup at position 152, are not yet assigned to PRs; see [Commits after the mapped tip](#commits-after-the-mapped-tip). - Upstream main: `ca6b2b177da5e33ae1bcac72986b31d6b039811c` (2026-11-02), one commit past the fork base; see [Upstream main past the fork base](#upstream-main-past-the-fork-base). @@ -209,7 +209,7 @@ position 046 and the portb console of PR15's position 064 keep the guest output peer leaves only when that write fails, and on Linux a write to an AF_UNIX peer that has closed fails with `EPIPE`, which upstream's backend reports as successful. Position 015 moves to PR13, ahead of position 046, so that it goes upstream with the policy that needs it. -microsoft/openvmm#4952 proposes positions 217-219 for `feature/microvm/dev`: position 217 +microsoft/openvmm#4952 landed positions 217-219 on `feature/microvm/dev`: position 217 cherry-picks `48e0681e9` for PR06, position 218 explains and tests the write handling of position 015, and position 219 tests that a `Retain` console keeps that output for the next peer. When the chain moves onto an upstream main that has `48e0681e9`, drop position 217 and keep position 015: @@ -687,7 +687,8 @@ c6d3da0ff -> boot console exit drain [211] -> portb without host input [212-213] -> long Windows paths [214] -> snapshot quiesce without a deadline [215-216] -> PR06 read fix [217] -> PR13 fixups [218-219] - -> 6fb64731f (NVX pin) + -> port forward bind code [220] + -> e1ca353eb (NVX pin) ``` For upstream review, PR01-PR07 and PR14 can be rebased independently onto current upstream main, @@ -706,13 +707,13 @@ that has `48e0681e9`; see [Open upstream pull requests](#open-upstream-pull-requ ## Commits after the mapped tip -The NVX pin extends the chain past position 135 without merges. Of the 84 later commits, position +The NVX pin extends the chain past position 135 without merges. Of the 85 later commits, position 152 is a PR20 fixup, position 217 is PR06's copy of a change that upstream has landed, positions 218 and 219 are PR13 fixups, and the others are not yet classified or assigned to PRs. Each of positions 136-191 combines the v2.4 commits that the table lists, as v3.0 positions 145-200 did, which developed one concept; "(part)" marks a v2.4 fixup that split across commits. Positions 192-196 followed the v3.0 reorganization, positions 197-210 are the ABI restart of the v4.0 -reorganization, and positions 211-219 followed it, so they combine none. +reorganization, and positions 211-220 followed it, so they combine none. | Position | Commit | v3.0 position | v2.4 positions | Topic | | ---: | --- | ---: | --- | --- | @@ -800,6 +801,7 @@ reorganization, and positions 211-219 followed it, so they combine none. | 217 | `62b427a38` | - | - | serial_socket: report read errors as EOF and drop the connection (microsoft/openvmm#4952; PR06's microsoft/openvmm#4605, merged as `48e0681e9`) | | 218 | `3f5224fd2` | - | - | serial_socket: document and test why a failed write drops the connection (microsoft/openvmm#4952; fold into 015) | | 219 | `6fb64731f` | - | - | virtio_console: test that Retain keeps output for the next peer (microsoft/openvmm#4952; fold into 047) | +| 220 | `e1ca353eb` | - | - | net_consomme: give a port forward that cannot bind a stable code (microsoft/openvmm#4951) | The remarks that say whether commits apply to upstream main record what the v3.0 reorganization found on its base, `b2676222b`, at the positions that the commits have now. @@ -924,6 +926,15 @@ upstream main has since merged position 217's change as `48e0681e9`, and positio fold into PR13. Position 218's test runs on Linux only, since on Windows the first write after an AF_UNIX peer closes is accepted and the next fails with `ConnectionReset`. +Position 220 leads the error with which the Consomme resolver, which upstream main has, reports a +port forward that it cannot bind with the stable code `E_PORT_FORWARD_BIND`, renames the helper with +which position 143's fatal error finds the first code of an error chain, and gives the code in the +Guide's sentences on the forwards of positions 179, 183, and 186 and on the time ABI codes of +position 151. It changes nothing that a mapped PR adds, but its resolver test builds a Consomme +handle with the fields that PR13's position 051 and positions 173 and 179 add. Replaying it on +upstream main conflicts in all four of its files, one of which, the verification module of position +143, upstream main lacks, so it follows those commits upstream. + ## PR summary Each count is of v4.0 commits, which include the fixups that the v3.0 reorganization folded into