Skip to content

guest: delete the space items that only tests use (SL6.11d) - #1547

Merged
Pedro Henrique Penna (ppenna) merged 1 commit into
feature/nvx-refactorfrom
agents/slim-sl6-11d-space-test-only
Nov 12, 2026
Merged

Pedro Henrique Penna (ppenna) merged 1 commit into
feature/nvx-refactorfrom
agents/slim-sl6-11d-space-test-only

Conversation

@ppenna

@ppenna Pedro Henrique Penna (ppenna) commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

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's apply_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_HOSTNAME and MAX_HOSTNAME_BYTES, which nothing used (the activation record's own nvx::activation::MAX_HOSTNAME_BYTES stays).
  • The mapper (guest::mappings::mapper): Mapper::{apply, check, is_latched, teardown, teardown_with}, and bind and bind_with, with guest::mappings' re-export of bind. apply_with, unmount_with, bind_retained_with and unbind_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 private Root::apply and mapping_mount that only map called; the accessors of Lower, AssemblyError, TeardownError (failures) and Unmount, and Unmount's path, which only its accessor read. Root keeps its fields, which its assembly, its teardown and its Debug form read. mount_runtime's guard against a live mount beneath /run drops the Mount::Mapping variant, which only map put in the root's list (the view's binds, the other Mount::Mappings, are kept apart, in view_binds).
  • The activation's application: 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 legacy binds field, always None, which only binds exposed (its Display now matches on the root's failure); and ApplyError::MachineId, which nothing constructed, with its arm in nvx-init's status classes. apply_with checks the view's result instead of keeping its machine ID.
  • Docs: the module docs of guest::root, guest::mappings and its mapper, guest::activation and guest, and nvx-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 through unmount_with. The public API snapshot nvx-rs/public-api/linux.txt drops the 47 hidden lines of the deleted items, and adds none; windows.txt doesn'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's apply_with, unmount_with, bind_retained_with and unbind_with, and the activation's apply, Applied's other accessors and teardown.

Old tests of the area

The tests read private fields directly, or map and unmount through apply_with, unmount_with and bind_retained_with, as NVX's programs do. root::tests::assembly_failure reads an AssemblyError's error for the application's tests in activation::state::apply::tests.

  • Retired, with the code that they tested, and the kept behavior that still covers each:
    • guest::root::tests::mappings_apply_beneath_the_overlay_in_order_and_go_first_at_the_teardown tested Root::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_switch maps 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, and guest::root::tests::shares_are_mounted_restricted_and_torn_down_first_in_reverse_order the 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) tested mount_runtime's refusal after a Root::map mapping beneath /run. A root's own mounts beneath /run are now only live shares and an aggregate's children, whose refusal guest::root::tests::runtime::a_call_after_a_share_or_a_child_is_refused_before_it_changes_anything checks, and a caller's mappings beneath /run after the runtime are guest::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_parts tested Applied::into_parts. The root's ownership of the view's binds stays covered by guest::root::tests::view::{a_later_bind_failure_stays_owned_and_its_teardown_removes_the_earlier_bind, teardown_reports_each_view_bind_that_stays_mounted} and guest::root::tests::privileged::view_failure_after_the_machine_id_bind_leaves_it_owned_for_teardown.
    • The helpers Applied::from_test_root (apply's tests) and source (root's runtime tests), which only those tests used.
  • Renamed, with what they no longer test:
    • 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 its Root::map case.
    • 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 through Root::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.
  • Rewritten in place:
    • 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 a Root::map mapping.
    • 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 /run mount added, then unmount through unmount_with, as nvx-init makes its mapper.
    • guest::init::boot::tests::a_failed_activation_ends_the_vm_with_the_status_of_its_class drops its ApplyError::MachineId case; guest::activation::state::apply::tests::a_valid_activate_activates_the_root_and_the_workload_once_before_ready drops its asserts of the machine ID and the resolver.
    • guest::mappings::mapper::tests::a_teardown_unmounts_in_reverse_order_and_reports_each_failure asserts unmount_with's failures, [(1, renamed), (0, covered)], then builds a TeardownError of them for its Display check.
    • The other 71 changes, 69 tests and the two refusal helpers of the mapper's test fixtures, read a field in place of a deleted accessor, such as mapper.latched for is_latched() or error.failures for failures(), call apply_with(&mut SystemKernel, ...) and unmount_with in place of apply and teardown, bind_retained_with(...).map_err(|failure| failure.error) in place of bind_with, or check_target(mapping.target()) in place of check, without changing what they assert.
  • Added: the doc examples of guest::root (line 126) and guest::mappings::mapper (line 107) used deleted items, so they become the compile-only unit tests guest::root::tests::a_layered_root_s_steps_compile and guest::mappings::mapper::tests::a_mapper_s_steps_compile, without the deleted calls, as the case matrix says. doc/acceptance-case-matrix.md names them, the renamed test, and the guest::activation example's new line, 157.

Size

Measured as #1076 defines them, against #1542's head 308b2554:

Core lines Counted files
Estimate (#1123) 0 —
Measured 13 7
  • Core lines (13): 10 in guest/activation/state/apply.rs (two imports without the deleted items, AppliedTeardownError's Display as a match on its root, apply_with's check of the view's result in place of the machine ID that it kept, and teardown_with's error without the binds field), 1 in guest/init/boot.rs (the View arm without MachineId), 1 in guest/mappings.rs (the re-export without bind) and 1 in guest/root.rs (mount_runtime's guard without Mount::Mapping).
  • Counted files (7), in nvx-rs/src/guest/: activation/state/apply.rs, init/boot.rs, mappings.rs, mappings/mapper.rs, root.rs, root/share.rs and view.rs. Not counted: activation.rs, mappings/table.rs and mod.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. At 1b348b47, these passed: on Windows, cargo fmt --all --check, cargo clippy --locked ... -- -D warnings for x86_64-unknown-linux-gnu (--all-targets --all-features, and --lib --no-default-features --features guest) and for x86_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; on nvx-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-features and python3 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-features and --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 for x86_64-unknown-linux-gnu: passed.
  • python scripts/public_api.py --update: linux.txt drops 47 hidden lines; python scripts/public_api.py then passed.
  • python scripts/check_test_layout.py, python scripts/check_markdown_links.py, and the case matrix's check against its baseline 99d2022085f: passed.
  • The Python unit tests of .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-rs at d929dde4, with default signal handling:

  • cargo fmt --all --check and the Clippy matrix above, with --all-targets --no-default-features --features guest for 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) and guest::managed_agent::{dispatch::tests, tests::loopback::tests} (21).
  • cargo test --locked, cargo build --locked --lib --no-default-features and cargo 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) and cargo 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 4 guest::init::tests::exec names as guest: delete the process modules and cgroups (SL6.11b) #1542's head on this host.
  • python3 scripts/nvx.py build-guest-binaries and test-guest-binaries: passed (33 of 33).

MicroVM scenarios, nvx-kvm-test (KVM), at d929dde4: the kernel built from this head in CI's Docker image (kernel-artifacts, vmlinux 8b133efd…, identical to #1542's K1 kernel, without CONFIG_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-modules lists 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 the tests-modified label.

Deliberately left

@ppenna Pedro Henrique Penna (ppenna) added tests-modified Changes existing tests, test data, or test wiring feat-nvx-refactor labels Nov 12, 2026
@github-actions

github-actions Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

This pull request changes existing tests

It 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

Change What Before After
modified helper fn refusal in guest::mappings::mapper::tests, impl Fixture`` nvx-rs/src/guest/mappings/mapper/tests.rs:93 nvx-rs/src/guest/mappings/mapper/tests.rs:93
modified helper fn refusal in guest::mappings::mapper::tests::privileged, impl Scene`` nvx-rs/src/guest/mappings/mapper/tests/privileged.rs:95 nvx-rs/src/guest/mappings/mapper/tests/privileged.rs:95
modified test fn a_valid_activate_activates_the_root_and_the_workload_once_before_ready in guest::activation::state::apply::tests nvx-rs/src/guest/activation/state/apply/tests.rs:320 nvx-rs/src/guest/activation/state/apply/tests.rs:322
modified test fn a_failed_assembly_is_final_and_reads_and_tears_down_nothing in guest::activation::state::apply::tests nvx-rs/src/guest/activation/state/apply/tests.rs:573 nvx-rs/src/guest/activation/state/apply/tests.rs:567
modified test fn the_record_s_view_is_applied_once_with_its_own_dns_and_returned_machine_id in guest::activation::state::apply::tests (renamed to the_record_s_view_is_applied_once_with_its_own_dns) nvx-rs/src/guest/activation/state/apply/tests.rs:599 nvx-rs/src/guest/activation/state/apply/tests.rs:593
modified test fn the_application_refuses_without_privileges_what_it_cannot_assemble in guest::activation::state::apply::tests nvx-rs/src/guest/activation/state/apply/tests.rs:792 nvx-rs/src/guest/activation/state/apply/tests.rs:774
modified test fn a_failed_activation_ends_the_vm_with_the_status_of_its_class in guest::init::boot::tests nvx-rs/src/guest/init/boot/tests.rs:278 nvx-rs/src/guest/init/boot/tests.rs:279
modified test fn layered_cold_boot_maps_through_handles_opened_before_its_only_switch in guest::init::boot::tests nvx-rs/src/guest/init/boot/tests.rs:821 nvx-rs/src/guest/init/boot/tests.rs:814
modified test fn mappings_are_restricted_copies_attached_in_order in guest::mappings::mapper::tests nvx-rs/src/guest/mappings/mapper/tests.rs:121 nvx-rs/src/guest/mappings/mapper/tests.rs:121
modified test fn targets_that_would_shadow_a_mapping_or_a_mount_are_refused in guest::mappings::mapper::tests nvx-rs/src/guest/mappings/mapper/tests.rs:426 nvx-rs/src/guest/mappings/mapper/tests.rs:426
modified test fn a_mapping_covers_the_root_of_a_mount_that_the_root_owns in guest::mappings::mapper::tests nvx-rs/src/guest/mappings/mapper/tests.rs:461 nvx-rs/src/guest/mappings/mapper/tests.rs:462
modified test fn reserved_targets_and_their_ancestors_are_refused in guest::mappings::mapper::tests nvx-rs/src/guest/mappings/mapper/tests.rs:499 nvx-rs/src/guest/mappings/mapper/tests.rs:500
modified test fn the_first_failure_latches_the_mapper in guest::mappings::mapper::tests nvx-rs/src/guest/mappings/mapper/tests.rs:583 nvx-rs/src/guest/mappings/mapper/tests.rs:585
modified test fn a_mapping_that_a_rename_moved_is_detached_and_refused in guest::mappings::mapper::tests nvx-rs/src/guest/mappings/mapper/tests.rs:685 nvx-rs/src/guest/mappings/mapper/tests.rs:687
modified test fn a_teardown_unmounts_in_reverse_order_and_reports_each_failure in guest::mappings::mapper::tests nvx-rs/src/guest/mappings/mapper/tests.rs:820 nvx-rs/src/guest/mappings/mapper/tests.rs:822
modified test fn a_runtime_bind_skips_the_checks_of_a_host_mapping_but_not_the_walk in guest::mappings::mapper::tests nvx-rs/src/guest/mappings/mapper/tests.rs:904 nvx-rs/src/guest/mappings/mapper/tests.rs:915
modified test fn runtime_binds_unbind_in_reverse_order_and_report_each_failure in guest::mappings::mapper::tests nvx-rs/src/guest/mappings/mapper/tests.rs:944 nvx-rs/src/guest/mappings/mapper/tests.rs:958
modified test fn an_empty_source_maps_the_source_root_itself_from_beneath_it in guest::mappings::mapper::tests nvx-rs/src/guest/mappings/mapper/tests.rs:1225 nvx-rs/src/guest/mappings/mapper/tests.rs:1239
modified test fn a_rename_race_never_mounts_outside_the_target in guest::mappings::mapper::tests::privileged nvx-rs/src/guest/mappings/mapper/tests/privileged.rs:271 nvx-rs/src/guest/mappings/mapper/tests/privileged.rs:273
modified test fn kinds_nested_targets_and_reserved_targets_are_checked in guest::mappings::mapper::tests::privileged nvx-rs/src/guest/mappings/mapper/tests/privileged.rs:323 nvx-rs/src/guest/mappings/mapper/tests/privileged.rs:325
modified test fn an_empty_source_maps_a_copy_of_the_source_root_s_own_mount in guest::mappings::mapper::tests::privileged nvx-rs/src/guest/mappings/mapper/tests/privileged.rs:387 nvx-rs/src/guest/mappings/mapper/tests/privileged.rs:393
modified test fn a_mapping_covers_the_root_of_a_mount_only_if_the_root_owns_it in guest::mappings::mapper::tests::privileged nvx-rs/src/guest/mappings/mapper/tests/privileged.rs:441 nvx-rs/src/guest/mappings/mapper/tests/privileged.rs:449
modified test fn a_workload_that_is_not_root_enters_what_a_mapper_created_whatever_the_umask_or_a_default_acl in guest::mappings::mapper::tests::privileged nvx-rs/src/guest/mappings/mapper/tests/privileged.rs:481 nvx-rs/src/guest/mappings/mapper/tests/privileged.rs:491
modified test fn a_read_only_mapping_is_never_visible_writable in guest::mappings::mapper::tests::privileged nvx-rs/src/guest/mappings/mapper/tests/privileged.rs:544 nvx-rs/src/guest/mappings/mapper/tests/privileged.rs:556
modified test fn a_teardown_unmounts_each_mapping_and_reports_a_busy_one in guest::mappings::mapper::tests::privileged nvx-rs/src/guest/mappings/mapper/tests/privileged.rs:598 nvx-rs/src/guest/mappings/mapper/tests/privileged.rs:614
modified test fn a_thread_with_a_descriptor_table_of_its_own_tears_its_mappings_down in guest::mappings::mapper::tests::privileged nvx-rs/src/guest/mappings/mapper/tests/privileged.rs:642 nvx-rs/src/guest/mappings/mapper/tests/privileged.rs:661
modified test fn assembly_mounts_the_image_and_the_scratch_under_the_overlay in guest::root::tests nvx-rs/src/guest/root/tests.rs:467 nvx-rs/src/guest/root/tests.rs:473
modified test fn devices_are_found_when_they_appear_and_missing_ones_time_out in guest::root::tests nvx-rs/src/guest/root/tests.rs:527 nvx-rs/src/guest/root/tests.rs:533
modified test fn an_assembly_waits_for_its_devices_until_its_deadline_at_the_latest in guest::root::tests nvx-rs/src/guest/root/tests.rs:568 nvx-rs/src/guest/root/tests.rs:574
modified test fn a_device_of_another_size_is_refused_before_it_is_flushed in guest::root::tests nvx-rs/src/guest/root/tests.rs:668 nvx-rs/src/guest/root/tests.rs:674
modified test fn the_expected_uuid_is_checked_in_the_superblock_before_the_mount in guest::root::tests nvx-rs/src/guest/root/tests.rs:700 nvx-rs/src/guest/root/tests.rs:706
modified test fn a_failed_assembly_unmounts_what_it_mounted_and_reports_what_stays in guest::root::tests nvx-rs/src/guest/root/tests.rs:741 nvx-rs/src/guest/root/tests.rs:747
modified test fn a_runtime_directory_that_the_overlay_options_reserve_is_refused in guest::root::tests nvx-rs/src/guest/root/tests.rs:804 nvx-rs/src/guest/root/tests.rs:808
modified test fn a_runtime_directory_whose_path_is_not_canonical_is_refused in guest::root::tests nvx-rs/src/guest/root/tests.rs:819 nvx-rs/src/guest/root/tests.rs:823
modified test fn a_root_mounts_nothing_through_a_symbolic_link in guest::root::tests nvx-rs/src/guest/root/tests.rs:857 nvx-rs/src/guest/root/tests.rs:861
modified test fn a_fresh_upper_s_directories_must_be_missing_or_empty in guest::root::tests nvx-rs/src/guest/root/tests.rs:962 nvx-rs/src/guest/root/tests.rs:966
modified test fn the_freshness_check_takes_one_entry_of_a_directory_and_opens_none in guest::root::tests nvx-rs/src/guest/root/tests.rs:1062 nvx-rs/src/guest/root/tests.rs:1066
modified test fn a_runtime_directory_that_another_root_holds_is_refused in guest::root::tests nvx-rs/src/guest/root/tests.rs:1093 nvx-rs/src/guest/root/tests.rs:1097
modified test fn a_runtime_directory_where_a_file_system_is_mounted_is_refused in guest::root::tests nvx-rs/src/guest/root/tests.rs:1173 nvx-rs/src/guest/root/tests.rs:1177
modified test fn a_runtime_directory_where_a_directory_is_bound_is_refused in guest::root::tests nvx-rs/src/guest/root/tests.rs:1388 nvx-rs/src/guest/root/tests.rs:1397
modified test fn a_gpt_disk_s_layers_are_mounted_under_the_overlay_top_first in guest::root::tests nvx-rs/src/guest/root/tests.rs:1480 nvx-rs/src/guest/root/tests.rs:1489
modified test fn both_overlay_modes_assemble_on_both_uppers_with_their_own_option_sets in guest::root::tests nvx-rs/src/guest/root/tests.rs:1591 nvx-rs/src/guest/root/tests.rs:1597
modified test fn a_tmpfs_upper_refuses_a_cap_that_is_not_1_to_90_percent in guest::root::tests nvx-rs/src/guest/root/tests.rs:1730 nvx-rs/src/guest/root/tests.rs:1736
modified test fn a_refused_option_set_fails_without_a_fallback in guest::root::tests nvx-rs/src/guest/root/tests.rs:1757 nvx-rs/src/guest/root/tests.rs:1763
modified test fn an_overlay_that_the_kernel_mounts_without_its_mode_in_effect_is_refused_and_unmounted in guest::root::tests nvx-rs/src/guest/root/tests.rs:1811 nvx-rs/src/guest/root/tests.rs:1817
modified test fn options_that_the_kernel_does_not_show_have_their_defaults in guest::root::tests nvx-rs/src/guest/root/tests.rs:1868 nvx-rs/src/guest/root/tests.rs:1874
modified test fn effective_options_that_cannot_be_read_fail_the_assembly in guest::root::tests nvx-rs/src/guest/root/tests.rs:1927 nvx-rs/src/guest/root/tests.rs:1933
modified test fn overlay_options_that_a_mount_cannot_pass_are_refused_before_any_mount in guest::root::tests nvx-rs/src/guest/root/tests.rs:1986 nvx-rs/src/guest/root/tests.rs:1992
modified test fn up_to_195_layers_fit_in_the_overlay_s_options_below_run_nvx in guest::root::tests nvx-rs/src/guest/root/tests.rs:2037 nvx-rs/src/guest/root/tests.rs:2043
modified test fn the_journal_policy_is_checked_in_the_scratch_s_superblock_before_any_mount in guest::root::tests nvx-rs/src/guest/root/tests.rs:2090 nvx-rs/src/guest/root/tests.rs:2096

... and 39 more, which the job's summary lists.

Relocated unchanged: 0; added: 3. Compared the merge base c1198c703563 with fb903d559382.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The guest-space API cleanup has no active review issues.

No open issues 🎉

Review effort: Balanced

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feat-nvx-refactor tests-modified Changes existing tests, test data, or test wiring

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants