Repository navigation
guest: delete the space items that only tests use (SL6.11d) - #1547
Merged
Pedro Henrique Penna (ppenna) merged 1 commit intoNov 12, 2026
Merged
Pedro Henrique Penna (ppenna) merged 1 commit into
Pedro Henrique Penna (ppenna) merged 1 commit into
Conversation
Contributor
This pull request changes existing testsIt modifies or removes 89 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
... and 39 more, which the job's summary lists. Relocated unchanged: 0; added: 3. Compared the merge base |
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues remain for the guest-space API cleanup.
No open issues 🎉
What changed in this PR
This PR removes guest-space APIs used only by tests, advancing NVX’s slimming workstream and preparing the space modules to become crate-private in SL6.13b. It retains the mapping and root operations used by NVX’s guest programs.
Changes:
- Deletes unused mapper wrappers, root accessors, activation result fields, and legacy error variants.
- Adapts tests to retained operations and private fields, retires obsolete cases, and moves two documentation examples into compile-only unit tests.
- Updates documentation, acceptance-case references, and the Linux public API snapshot.
| File | Description |
|---|---|
nvx-rs/src/guest/view.rs |
Removes unused hostname constants. |
nvx-rs/src/guest/root/tests/view.rs |
Removes the ownership-transfer test and updates field assertions. |
nvx-rs/src/guest/root/tests/switch.rs |
Reads teardown failures directly. |
nvx-rs/src/guest/root/tests/runtime.rs |
Replaces removed mapping cases with aggregate-child coverage. |
nvx-rs/src/guest/root/tests/privileged.rs |
Uses caller-owned mappers in privileged tests. |
nvx-rs/src/guest/root/tests.rs |
Updates assertions, retires obsolete cases, and adds compile-only coverage. |
nvx-rs/src/guest/root/share.rs |
Deletes Root::map and its private helpers. |
nvx-rs/src/guest/root.rs |
Removes report accessors and unused teardown path data. |
nvx-rs/src/guest/mod.rs |
Corrects the root module’s documented responsibilities. |
nvx-rs/src/guest/mappings/table.rs |
Documents caller ownership of mappings. |
nvx-rs/src/guest/mappings/mapper/tests/privileged.rs |
Uses retained apply and unmount operations. |
nvx-rs/src/guest/mappings/mapper/tests.rs |
Adapts mapper tests and adds compile-only coverage. |
nvx-rs/src/guest/mappings/mapper.rs |
Deletes test-only wrappers and documents retained operations. |
nvx-rs/src/guest/mappings.rs |
Removes the bind export and updates ownership documentation. |
nvx-rs/src/guest/init/boot/tests.rs |
Drops the legacy error case and uses apply_with. |
nvx-rs/src/guest/init/boot.rs |
Removes classification of the deleted machine-ID error. |
nvx-rs/src/guest/activation/state/apply/tests.rs |
Removes obsolete result assertions and updates error inspection. |
nvx-rs/src/guest/activation/state/apply.rs |
Removes unused results, accessors, and legacy error state. |
nvx-rs/src/guest/activation.rs |
Removes documentation of Applied::into_parts. |
nvx-rs/README.md |
Aligns module descriptions with retained APIs and ownership. |
nvx-rs/public-api/linux.txt |
Removes 47 snapshot entries for deleted hidden APIs. |
doc/acceptance-case-matrix.md |
Updates renamed tests and relocated documentation examples. |
Review effort: Balanced
Pedro Henrique Penna (ppenna)
force-pushed
the
agents/slim-sl6-11b-process-modules
branch
from
November 12, 2026 17:19
308b255 to
9830b1e
Compare
Pedro Henrique Penna (ppenna)
force-pushed
the
agents/slim-sl6-11d-space-test-only
branch
from
November 12, 2026 17:28
d929dde to
1b348b4
Compare
Base automatically changed from
agents/slim-sl6-11b-process-modules
to
feature/nvx-refactor
November 12, 2026 17:43
Once the old layered init, the exec engine and the process modules left, the guest's space kept many public items that no NVX program calls: nvx-init and the managed agent map through the mapper's apply_with, never tear a mapper down, and read none of the root's reports. SL6.13b (#1127) makes the space crate-private, which would leave these items dead in every feature set, so this commit deletes them first, with what the compiler then finds unused, as SL6.11d in #1123 records. Deleted: - guest::view's DEFAULT_HOSTNAME and MAX_HOSTNAME_BYTES, which nothing used. - The mapper's apply, check, is_latched, teardown and teardown_with, and bind and bind_with, with guest::mappings' re-export of bind. apply_with, unmount_with, bind_retained_with and unbind_with stay, and take the documentation of what they implemented. - Root's is_latched, first_partition, lowers, upper, overlay and map, with the private apply and mapping_mount that only map called, the accessors of Lower, AssemblyError, TeardownError and Unmount, and Unmount's path, which only its accessor read. Root keeps its fields, which its assembly, teardown and Debug form read, and mount_runtime's guard against a mapping beneath /run loses the variant that only map recorded. A root mounts its live shares through its mapper, and the caller maps its host mappings through a mapper of its own, as nvx-init does. - Applied's hostname, machine_id, resolver and into_parts, with the fields that only they read, and the seam result's matching fields; AppliedTeardownError's binds and root, with the legacy binds field, always None, which only the binds accessor exposed; and ApplyError::MachineId, which nothing constructed, with its arm in nvx-init's status classes. Tests: - Tests read private fields directly, or map and unmount through apply_with, unmount_with and bind_retained_with, as NVX's programs do. The tests of a clone's application, which can't read AssemblyError's field, use root::tests::assembly_failure. - mappings_apply_beneath_the_overlay_in_order_and_go_first_at_the_teardown, a_call_after_a_mapping_is_refused_and_leaves_it_reachable and an_applied_root_keeps_its_view_binds_when_transferred_into_parts retire with Root::map and into_parts. - The root's tests of a mapping that a rename moved and of shares beneath /run take an aggregate's child, a mapping of the root's mapper, in place of map's: a_call_after_a_share_or_a_child_... and shares_and_children_beneath_run_... take the place of the tests that named a mapping. the_host_export_..._unmounted_after_the_live_shares loses its mappings, and the privileged tests map through a mapper of the root, as nvx-init makes one. - the_record_s_view_is_applied_once_with_its_own_dns loses the machine ID and resolver that the application no longer reports. - The doc examples of guest::root and guest::mappings::mapper become the unit tests a_layered_root_s_steps_compile and a_mapper_s_steps_compile, without the deleted calls; the case matrix names them, the renamed test, and the activation example's new line. The public API snapshot loses 47 hidden lines, and adds none. The README and the module docs stop naming what left, and no longer say that a layered root mounts or keeps host mappings: the caller's mapper does. MappingTable's docs and the mapper's no longer name a mapper's teardown, which left: the table unmounts nothing, and a layered root's teardown unmounts its mapper's mappings through unmount_with. Part of #1123 (SL6.11d). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Pedro Henrique Penna (ppenna)
force-pushed
the
agents/slim-sl6-11d-space-test-only
branch
from
November 12, 2026 17:48
1b348b4 to
fb903d5
Compare
Pedro Henrique Penna (ppenna)
marked this pull request as ready for review
November 12, 2026 17:48
Pedro Henrique Penna (ppenna)
merged commit Nov 12, 2026
f859d5c
into
feature/nvx-refactor
83 of 84 checks passed
Pedro Henrique Penna (ppenna)
deleted the
agents/slim-sl6-11d-space-test-only
branch
November 12, 2026 18:06
This was referenced Nov 12, 2026
Closed
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.
Leaving code only. This PR changes only code that this effort removes from NVX: the guest space's items that no NVX program uses, only its unit tests, with the edits that remove references to them. Nothing that stays changes, and no later PR uses what it changes, so the size limits for kept code don't apply.
Part of #1123 (SL6.11d, "The space items that only tests use are gone"). Parent #1087, umbrella #1076.
Stacked on #1542 (SL6.11b).
What and why
SL6.13b (#1127) makes the guest's space crate-private:
guest::{root, view, gpt}, the mapper and the activation's application. Once the old layered init, the exec engine and the process modules left (SL7.8b, SL7.8c, SL6.11b), many of the space's public items have no caller but unit tests: nvx-init and the managed agent map host mapping tables through the mapper'sapply_with, never tear that mapper down, and read none of the root's reports. A crate-private space would leave them dead in every feature set, so, as decided on #1123 (#1123 (comment)), this slice deletes them first, with what the compiler then finds unused. One commit,1b348b47.Deleted
guest::view:DEFAULT_HOSTNAMEandMAX_HOSTNAME_BYTES, which nothing used (the activation record's ownnvx::activation::MAX_HOSTNAME_BYTESstays).guest::mappings::mapper):Mapper::{apply, check, is_latched, teardown, teardown_with}, andbindandbind_with, withguest::mappings' re-export ofbind.apply_with,unmount_with,bind_retained_withandunbind_with, which NVX's programs use, stay, and take the rustdoc of what they implemented.guest::root:Root::{is_latched, first_partition, lowers, upper, overlay, map}, with the privateRoot::applyandmapping_mountthat onlymapcalled; the accessors ofLower,AssemblyError,TeardownError(failures) andUnmount, andUnmount'spath, which only its accessor read.Rootkeeps its fields, which its assembly, its teardown and itsDebugform read.mount_runtime's guard against a live mount beneath/rundrops theMount::Mappingvariant, which onlymapput in the root's list (the view's binds, the otherMount::Mappings, are kept apart, inview_binds).Applied::{hostname, machine_id, resolver, into_parts}, with the fields that only they read, and the seam result's matching fields;AppliedTeardownError::{binds, root}, with the legacybindsfield, alwaysNone, which onlybindsexposed (itsDisplaynow matches on the root's failure); andApplyError::MachineId, which nothing constructed, with its arm in nvx-init's status classes.apply_withchecks the view's result instead of keeping its machine ID.guest::root,guest::mappingsand its mapper,guest::activationandguest, andnvx-rs/README.md, stop naming what left, and no longer say that a layered root mounts or keeps host mappings: the caller's own mapper does, as nvx-init's.MappingTable's rustdoc and the mapper's no longer name a mapper's teardown, which left: the table unmounts nothing, the caller unmounts its mappings itself, if it ever does, and a layered root's teardown unmounts its mapper's mappings throughunmount_with. The public API snapshotnvx-rs/public-api/linux.txtdrops the 47 hidden lines of the deleted items, and adds none;windows.txtdoesn't change, as the guest is Linux-only.What stays: every item that NVX's programs use, unchanged: the assembly, live shares, export, runtime mounts, switch and teardown of
Root, the view, the mapper'sapply_with,unmount_with,bind_retained_withandunbind_with, and the activation'sapply,Applied's other accessors andteardown.Old tests of the area
The tests read private fields directly, or map and unmount through
apply_with,unmount_withandbind_retained_with, as NVX's programs do.root::tests::assembly_failurereads anAssemblyError's error for the application's tests inactivation::state::apply::tests.guest::root::tests::mappings_apply_beneath_the_overlay_in_order_and_go_first_at_the_teardowntestedRoot::map. Mappings beneath a layered root go through a mapper of the caller's own:guest::init::boot::tests::layered_cold_boot_maps_through_handles_opened_before_its_only_switchmaps beneath nvx-init's root as production does,guest::mappings::mapper::tests::{mappings_are_restricted_copies_attached_in_order, a_teardown_unmounts_in_reverse_order_and_reports_each_failure}check the order of the attach and of the unmount, andguest::root::tests::shares_are_mounted_restricted_and_torn_down_first_in_reverse_orderthe root's teardown of its live shares.guest::root::tests::privileged::a_call_after_a_mapping_is_refused_and_leaves_it_reachable(ignored, root only) testedmount_runtime's refusal after aRoot::mapmapping beneath/run. A root's own mounts beneath/runare now only live shares and an aggregate's children, whose refusalguest::root::tests::runtime::a_call_after_a_share_or_a_child_is_refused_before_it_changes_anythingchecks, and a caller's mappings beneath/runafter the runtime areguest::root::tests::privileged::mappings_beneath_run_after_the_runtime_are_on_its_tmpfs_and_go_with_it's.guest::root::tests::view::an_applied_root_keeps_its_view_binds_when_transferred_into_partstestedApplied::into_parts. The root's ownership of the view's binds stays covered byguest::root::tests::view::{a_later_bind_failure_stays_owned_and_its_teardown_removes_the_earlier_bind, teardown_reports_each_view_bind_that_stays_mounted}andguest::root::tests::privileged::view_failure_after_the_machine_id_bind_leaves_it_owned_for_teardown.Applied::from_test_root(apply's tests) andsource(root's runtime tests), which only those tests used.guest::root::tests::runtime::a_call_after_a_share_a_child_or_a_mapping_is_refused_before_it_changes_anything→a_call_after_a_share_or_a_child_is_refused_before_it_changes_anything, without itsRoot::mapcase.guest::root::tests::runtime::shares_and_mappings_beneath_run_after_the_runtime_are_on_its_tmpfs_and_unmounted_first→shares_and_children_beneath_run_after_the_runtime_are_on_its_tmpfs_and_unmounted_first: its mapping became an aggregate's child, a mount of the root's own mapper.guest::root::tests::the_host_export_is_mounted_out_of_the_root_and_unmounted_after_its_mappings→the_host_export_is_mounted_out_of_the_root_and_unmounted_after_the_live_shares, without the mappings that it mapped throughRoot::map.guest::activation::state::apply::tests::the_record_s_view_is_applied_once_with_its_own_dns_and_returned_machine_id→the_record_s_view_is_applied_once_with_its_own_dns, without the machine ID and resolver that the application no longer reports.guest::root::tests::a_share_or_a_mapping_that_a_rename_moved_and_that_stays_is_the_teardown_s: its mapping case takes an aggregate's child,Mount::Child, in place of aRoot::mapmapping.guest::root::tests::privileged::{mappings_beneath_run_after_the_runtime_are_on_its_tmpfs_and_go_with_it, a_switched_root_keeps_its_mounts_and_maps_through_earlier_descriptors}(ignored, root only) map through a mapper of the root's base with its/runmount added, then unmount throughunmount_with, as nvx-init makes its mapper.guest::init::boot::tests::a_failed_activation_ends_the_vm_with_the_status_of_its_classdrops itsApplyError::MachineIdcase;guest::activation::state::apply::tests::a_valid_activate_activates_the_root_and_the_workload_once_before_readydrops its asserts of the machine ID and the resolver.guest::mappings::mapper::tests::a_teardown_unmounts_in_reverse_order_and_reports_each_failureassertsunmount_with's failures,[(1, renamed), (0, covered)], then builds aTeardownErrorof them for itsDisplaycheck.refusalhelpers of the mapper's test fixtures, read a field in place of a deleted accessor, such asmapper.latchedforis_latched()orerror.failuresforfailures(), callapply_with(&mut SystemKernel, ...)andunmount_within place ofapplyandteardown,bind_retained_with(...).map_err(|failure| failure.error)in place ofbind_with, orcheck_target(mapping.target())in place ofcheck, without changing what they assert.guest::root(line 126) andguest::mappings::mapper(line 107) used deleted items, so they become the compile-only unit testsguest::root::tests::a_layered_root_s_steps_compileandguest::mappings::mapper::tests::a_mapper_s_steps_compile, without the deleted calls, as the case matrix says.doc/acceptance-case-matrix.mdnames them, the renamed test, and theguest::activationexample's new line, 157.Size
Measured as #1076 defines them, against #1542's head
308b2554:guest/activation/state/apply.rs(two imports without the deleted items,AppliedTeardownError'sDisplayas a match on its root,apply_with's check of the view's result in place of the machine ID that it kept, andteardown_with's error without thebindsfield), 1 inguest/init/boot.rs(theViewarm withoutMachineId), 1 inguest/mappings.rs(the re-export withoutbind) and 1 inguest/root.rs(mount_runtime's guard withoutMount::Mapping).nvx-rs/src/guest/:activation/state/apply.rs,init/boot.rs,mappings.rs,mappings/mapper.rs,root.rs,root/share.rsandview.rs. Not counted:activation.rs,mappings/table.rsandmod.rs(rustdoc only), tests, docs, and the generated API snapshot.Validation
The runs below ran at
d929dde4. The head,1b348b47, differs from it only in rustdoc, a fix from SL6.10c's review:MappingTable's and the mapper's docs no longer name a mapper's teardown. At1b348b47, these passed: on Windows,cargo fmt --all --check,cargo clippy --locked ... -- -D warningsforx86_64-unknown-linux-gnu(--all-targets --all-features, and--lib --no-default-features --features guest) and forx86_64-unknown-linux-musl(--all-targets --no-default-features --features guest),RUSTDOCFLAGS='-D warnings' cargo doc --locked --no-deps --all-features --target x86_64-unknown-linux-gnu, and the case matrix's check; onnvx-kvm-test,cargo clippy --locked --all-targets --all-features -- -D warnings,cargo test --locked --all-features --doc(15 and 1 passed),RUSTDOCFLAGS='-D warnings' cargo doc --locked --no-deps --all-featuresandpython3 scripts/public_api.py.Windows (local, at
d929dde4, Rust 1.95.0):cargo fmt --all --check: passed.cargo clippy --locked ... -- -D warnings, each passed:--all-targets --all-features;--lib;--lib --no-default-features;--lib --no-default-features --features serde;--lib --bins --features cli;--lib --bins --no-default-features --features testing;--all-targets --no-default-features --features guest; and, for the guest's code,--target x86_64-unknown-linux-gnu --all-targets --all-featuresand--target x86_64-unknown-linux-musl --all-targets --no-default-features --features guest.RUSTDOCFLAGS='-D warnings' cargo doc --locked --no-deps --all-features, for Windows and forx86_64-unknown-linux-gnu: passed.python scripts/public_api.py --update:linux.txtdrops 47 hidden lines;python scripts/public_api.pythen passed.python scripts/check_test_layout.py,python scripts/check_markdown_links.py, and the case matrix's check against its baseline99d2022085f: passed..github/actions/validate-nvx: 1803 ran, 73 skipped, and 1 failed,test_nvx_tools.NvxRsTests.test_readme_gives_each_module_a_short_row_and_a_section, which guest: delete the process modules and cgroups (SL6.11b) #1542's head fails too: since SL6.11b, the README's module table has 39 rows, and the test wants more than 40. This PR doesn't change the table.Linux,
nvx-kvm-test(KVM, Azure Linux 3.0, kernel 6.6.159, Rust 1.95.0), the commands of.github/actions/check-nvx-rsatd929dde4, with default signal handling:cargo fmt --all --checkand the Clippy matrix above, with--all-targets --no-default-features --features guestfor the host's target: passed.cargo test --locked --all-features: 1718 passed, 25 failed, 56 ignored in the library's unit tests; every other target passed, the doc tests 15 of 15. The 25 failures are the same names as guest: delete the process modules and cgroups (SL6.11b) #1542's head on this host, whose kernel 6.6 they need a later one for:guest::init::tests::exec(4) andguest::managed_agent::{dispatch::tests, tests::loopback::tests}(21).cargo test --locked,cargo build --locked --lib --no-default-featuresandcargo test --locked --lib --no-default-features: passed.RUSTDOCFLAGS='-D warnings' cargo doc --locked --no-deps --all-features,cargo +1.89 check --locked --all-targets --all-features(MSRV) andcargo check --locked --all-targets --all-features --target aarch64-apple-darwin: passed.python3 scripts/public_api.py: passed.python3 scripts/nvx.py check-guest-binaries --toolchain 1.95.0: Clippy passed; the musl tests 843 passed, 4 failed, the same 4guest::init::tests::execnames as guest: delete the process modules and cgroups (SL6.11b) #1542's head on this host.python3 scripts/nvx.py build-guest-binariesandtest-guest-binaries: passed (33 of 33).MicroVM scenarios,
nvx-kvm-test(KVM), atd929dde4: the kernel built from this head in CI's Docker image (kernel-artifacts,vmlinux8b133efd…, identical to #1542's K1 kernel, withoutCONFIG_MAGIC_SYSRQ), the Alpine initramfs built from this head (build-initramfs --guest alpine), nvx-rs built from this head, and CI run 43242544111's OpenVMM (14dc4116,75fb488d…), Ubuntu distro layer and sandbox scratch template, checked by SHA-256:test-microvm --backend kvm --processors 1 --scenario guest-boot --scenario console-exit --scenario console-snapshot --scenario filesystem-snapshot: all 4 passed.test-microvm --backend kvm --scenario sandbox-lifecycle --scenario snapshot-core(the public sandbox, and nvx-init's named snapshot restores and their activation): both passed.Code review: a review subagent read the whole diff; it found module docs and README text that still said that a layered root mounts or keeps host mappings, which this PR fixes; nothing else.
Not run: the ignored privileged tests, which need root on the host (
--ignored, as root); MSHV and WHP, since only the guest's code changes and it builds for Linux only. CI doesn't run on a Draft.python3 scripts/check_test_changes.py --base origin/agents/slim-sl6-11b-process-moduleslists 89 changes to existing tests (83 modified, 6 removed: 3 tests and 3 helpers; 4 of the modified ones renamed), none relocated, and 3 additions; "Old tests of the area" explains each, so the PR has thetests-modifiedlabel.Deliberately left
guest::clone, the compatibility alias, andCaptureStage::Fence, which SL6.11c left: this slice doesn't touch them.