Repository navigation
guest: apply the VM-wide view through its root - #1339
Merged
Pedro Henrique Penna (ppenna) merged 6 commits intoNov 9, 2026
Merged
Pedro Henrique Penna (ppenna) merged 6 commits into
Pedro Henrique Penna (ppenna) merged 6 commits into
Conversation
Contributor
This pull request changes existing testsIt modifies or removes 6 existing test asset(s), listed below. Review each with care: a change to a test can hide a regression that the test caught. See doc/contribute.md#changes-to-existing-tests. Test code
Relocated unchanged: 3; added: 40. Compared the merge base |
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are reported for the VM-wide view application and root-owned binding changes.
No open issues 🎉
What changed in this PR
Adds VM-wide view application to NVX’s hidden guest reference code, building on the existing view configuration and root-switch support. Root owns the hostname-related file binds, removing them during teardown before switching and preserving them afterward.
Changes:
- Adds
view::applyfor decoded hostname bytes, image or generated machine IDs, and optional single-server DNS. - Centralizes binding helpers in
root, preserving legacy caller paths through delegation and re-exports. - Adds lifecycle and privileged tests, relocates existing coverage, and updates documentation and the Linux API snapshot.
| File | Description |
|---|---|
nvx-rs/src/guest/view/tests.rs |
Relocates machine-ID and resolver-format tests. |
nvx-rs/src/guest/view.rs |
Implements VM-wide view application and shared file generation. |
nvx-rs/src/guest/sys/mod.rs |
Re-exports the internal hostname setter. |
nvx-rs/src/guest/sys/entry.rs |
Makes the hostname setter crate-visible and clarifies its namespace scope. |
nvx-rs/src/guest/root/tests/view.rs |
Tests view ownership, failure handling, teardown, and switch behavior. |
nvx-rs/src/guest/root/tests/privileged.rs |
Adds real hostname, bind, teardown, and root-switch tests. |
nvx-rs/src/guest/root/tests.rs |
Registers the view test module. |
nvx-rs/src/guest/root.rs |
Owns view attachments and centralizes runtime binding helpers. |
nvx-rs/src/guest/mod.rs |
Exposes and documents the hidden view module. |
nvx-rs/src/guest/entry/tests.rs |
Moves shared helper tests to their new owners. |
nvx-rs/src/guest/entry.rs |
Delegates binding and re-exports existing identity symbols. |
nvx-rs/src/guest/clone/activation/apply/tests.rs |
Moves resolver-file coverage to the view module. |
nvx-rs/src/guest/clone/activation/apply.rs |
Reuses shared identity and resolver helpers. |
nvx-rs/README.md |
Documents view application and bind ownership. |
nvx-rs/public-api/linux.txt |
Records the hidden view surface. |
Review effort: Balanced
Enrique Saurez (esaurez)
force-pushed
the
esaurez/slim-2.1.2-sl2.4a2-20261106
branch
from
November 7, 2026 23:21
68373ce to
7d4b7e8
Compare
Enrique Saurez (esaurez)
force-pushed
the
esaurez/slim-2.4.1-sl7.2-20261106
branch
from
November 8, 2026 01:45
1ef1618 to
f26845b
Compare
Enrique Saurez (esaurez)
force-pushed
the
esaurez/slim-2.1.2-sl2.4a2-20261106
branch
from
November 8, 2026 04:58
7d4b7e8 to
43716c0
Compare
Base automatically changed from
esaurez/slim-2.1.2-sl2.4a2-20261106
to
feature/nvx-refactor
November 8, 2026 06:52
Enrique Saurez (esaurez)
force-pushed
the
esaurez/slim-2.4.1-sl7.2-20261106
branch
from
November 8, 2026 22:30
f26845b to
9c9b018
Compare
Enrique Saurez (esaurez)
changed the base branch from
feature/nvx-refactor
to
esaurez/slim-2.2.1-sl2.8-20261107
November 8, 2026 22:30
Enrique Saurez (esaurez)
marked this pull request as ready for review
November 8, 2026 23:18
Base automatically changed from
esaurez/slim-2.2.1-sl2.8-20261107
to
feature/nvx-refactor
November 9, 2026 01:22
Set the VM hostname from its view bytes and reuse the machine ID and single-server resolver formats. Keep every view bind, including failed attachments, with the root so teardown removes them before the switch and leaves them mounted afterwards. Preserve existing entry and activation callers through narrow re-exports and shared operations. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: f407efdc-4592-4fb9-8abc-095402b6df7b Copilot-Session: a773baad-9362-4d2f-be37-d4f9eda25cee
Check that switch teardown and drop issue no unmount or detach through the existing kernel seam, while native tests check bind availability after the actual switch. Cover refusal on switched or latched roots, keep resolver file cases with their new owner, and document the view bind failure latch. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: f407efdc-4592-4fb9-8abc-095402b6df7b Copilot-Session: a773baad-9362-4d2f-be37-d4f9eda25cee
Move the shared file-binding operations and their helper tests to the root. Root-wide runtime and view setup no longer depend on execution entry; legacy entry bindings reuse the same implementation. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: f407efdc-4592-4fb9-8abc-095402b6df7b Copilot-Session: a773baad-9362-4d2f-be37-d4f9eda25cee
Keep legacy entry tests independent of the production imports used by shared file bindings and account checks. Preserve their existing assertions and production behavior. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: f407efdc-4592-4fb9-8abc-095402b6df7b Copilot-Session: a773baad-9362-4d2f-be37-d4f9eda25cee
Enrique Saurez (esaurez)
force-pushed
the
esaurez/slim-2.4.1-sl7.2-20261106
branch
from
November 9, 2026 04:43
9c9b018 to
0f9a26b
Compare
Consume the prepared launch without reopening its resources and return its verified detached process, outputs and capability. Confirm the owned child exits if process verification fails. Preserve Linux umask handling and require a trusted Windows log-named job, with internal inheritance locking. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: b4a2ff9d-56d5-4635-9dc8-a5f78c8cbc6a Copilot-Session: d5e2370f-2500-4250-a1da-70d1661912e1
Resolve caller-relative executable, kernel, initramfs, root and scratch paths before rendering and checking the final launch command. Honor the configured hypervisor in the real-VM fixture and reuse the existing bounded job-claim release check without weakening the unrelated-child assertion. Cover relative inputs outside the VM directory and preserve required-path errors, log rollback and legacy spawn behavior. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: d5e2370f-2500-4250-a1da-70d1661912e1
Pedro Henrique Penna (ppenna)
merged commit Nov 9, 2026
ea2e024
into
feature/nvx-refactor
18 of 20 checks passed
Pedro Henrique Penna (ppenna)
deleted the
esaurez/slim-2.4.1-sl7.2-20261106
branch
November 9, 2026 05:18
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.
Closes #1104
Apply the VM-wide view once to an assembled root: set the decoded hostname bytes, preserve the image's machine ID or bind a generated UUID, and optionally bind the existing single-server resolver file. The hidden
guest::view::applyuses the existing crate-wide error contract and file formats; the activation record's limit and machine-ID modes stay unchanged.Rootowns successful binds and attachments retained after a failure. Teardown removes them before the root switch, while a switched root leaves them mounted. The existing file/runtime binding implementations now live inroot; legacyEntrydelegates to that one implementation. Existing caller paths remain usable. There is no new switch implementation, syscall layer, resolver framework, or per-execution view setup.This is stacked on #1342 at
0701ea5f, retaining the view configuration from #1312 and the runtime mounts and root-switch implementation from #1295.Size and API
296 core lines in seven production files, measured against
0701ea5f; 15 tracked paths including six test files, the README, and the Linux API snapshot. The seven production paths areguest/view.rs,guest/root.rs,guest/entry.rs,guest/clone/activation/apply.rs,guest/mod.rs,guest/sys/entry.rs, andguest/sys/mod.rs. Moved binding implementations are counted in full. The hidden view surface adds 11 snapshot lines; the supported mapping API stays unchanged.Tests
The exact-base inventory reports five modified existing assets, three unchanged relocations, and 20 added assets. No existing test is retired; no scenario, timeout, CI wiring, test-layout allowance, or production test hook is changed.
entry::tests::machine_ids_are_version_4_uuids_in_lowercase_hexadecimalview::tests; UUID version, variant, lowercase digits, and newline assertions retained.entry::tests::a_machine_id_is_generated_once_per_fileview::tests; exclusive creation, mode, symlink refusal, and distinct-ID assertions retained.entry::tests::a_generated_machine_id_has_mode_0444_whatever_the_umaskview::tests; the isolated child filter and existing process-isolation helper follow their current owners, with the same0444assertion.clone::activation::apply::tests::a_resolver_file_names_its_dns_server_once_and_every_execution_may_read_itview::tests, retaining IPv4/IPv6 text, mode, exclusive creation, and symlink assertions. It now compiles with its Linux guest owner instead of the old x86-64-only activation test module.entry::tests::runtime_sources_are_the_directories_beside_their_filesroot::tests::view.entry::tests::only_a_link_at_a_runtime_file_of_etc_is_removedroot::tests::view; the fixture creates its own root andetcdirectory. Existing symlink, regular-file, traversal, and target-policy assertions are retained.root::tests::privileged::Scene::rootNone; all existing scene behavior is retained.clone::activation::apply::testsThe existing privileged runtime/switch tests remain unchanged:
the_runtime_s_file_systems_have_an_execution_s_options_nodes_and_links,a_call_that_fails_part_of_the_way_unmounts_what_it_mounted,a_call_after_a_mapping_is_refused_and_leaves_it_reachable,mappings_beneath_run_after_the_runtime_are_on_its_tmpfs_and_go_with_it, anda_switched_root_keeps_its_mounts_and_maps_through_earlier_descriptors. Legacyprivileged_entries_see_their_own_view_and_identityandprivileged_runtime_binds_are_removed_before_a_teardownare kept too.New tests in
root::tests::view:the_root_removes_its_view_binds_in_reverse_order_before_the_overlayimage_mode_without_dns_binds_nothing_and_a_second_view_is_refusedinvalid_hostname_bytes_are_refused_before_any_view_effecta_later_bind_failure_stays_owned_and_its_teardown_removes_the_earlier_binda_switched_root_never_unmounts_or_detaches_its_view_bindsswitched_or_failed_roots_refuse_a_view_before_opening_its_rootteardown_reports_each_view_bind_that_stays_mounteda_view_bind_that_moves_and_cannot_detach_stays_owned_until_teardownNew privileged tests:
view_image_mode_applies_decoded_bytes_without_machine_id_or_resolver_bindsview_generated_id_and_dns_are_read_only_and_the_root_unmounts_themview_failure_after_the_machine_id_bind_leaves_it_owned_for_teardownview_binds_survive_the_actual_switch_teardown_refusal_and_dropThe remaining eight added assets are the two owner modules, their imports and inner attributes, and the
preparedandview_scenefixtures. They support these 12 new tests rather than adding hidden production hooks.Validation
Rebased head
The four own commits are rebased onto #1342 at
0701ea5f, producing9c9b0182(tree04d2a678) with the unchanged OpenVMM pin14dc4116. The only conflict combined two adjacent import deletions: the parent's obsoleteNonZeroU64import and the resolver test's oldPermissionsExt/symlinkimports. No test body, assertion, filter, timeout, API, or production behavior was changed by that resolution.python scripts/nvx.py verify,python scripts/check_test_layout.py,python scripts/check_test_changes.py --base 0701ea5f22d26fa193b7a6f4cba550de3158c68b, andcargo fmt --all --checkpassed on this head. The inventory remains five modified existing assets, three unchanged relocations, and 20 added assets.Full CI run 42530728776 completed successfully on exact head
9c9b0182: all 35 executed jobs succeeded, including both Rust/CLI platforms, guest builds, KVM/MSHV/WHP scenarios and packages, and the required status check. Eight conditional jobs stayed skipped: artifact-reuse rehearsal, performance regression gating, merge-group cancellation, performance persistence/recording, development release, and crate packaging/publication. Those skips are not reported as passes.Copilot's review 5820066487 of exact head
9c9b0182recommends approval, with no open issues and zero unresolved threads; its formal state isCOMMENTED, not a maintainer approval. The PR remains Draft. No earlier-source artifact or runtime result is substituted for this head's checks. Local compilation and runtime execution were not repeated for the import-only resolution.Earlier source qualification
The following results belong to the earlier qualified source
f26845b0, not the rebased head's CI or runtime execution.Completed applicable local checks at
f26845b0(treee25c652e), directly on published #13127d4b7e86with merged #1310 in its ancestry and inherited OpenVMM pin14dc4116:Both runtime runs used this candidate's own canonical CLI, static guest helpers and actual admitted prebuilt test runners. Existing matching native component binaries and the unchanged kernel were authenticated against current inputs; no other candidate's guest or test result was reused. The existing mount-only, data-backed temporary-directory route preserved the MSHV adapter's full command, cases, timeouts and PID/user/network namespaces. Independent read-only review found no blocking own-patch issue.
The earlier rebase conflict preserved the moved tests and followed the same shared process-isolation helper at its new location; no assertion or production behavior was changed. Earlier source, failures and interrupted prestart attempts remain separate. Completed commands were reused only with demonstrably exact inputs, and interrupted commands were rerun in full through the standard compiler entry. At that source qualification, KVM and GitHub CI were not run or queried locally; the PR remained Draft.