Repository navigation
host: import retained types from their low-level owners (SL6.0b) - #1477
Merged
Pedro Henrique Penna (ppenna) merged 1 commit intoNov 11, 2026
Merged
Pedro Henrique Penna (ppenna) merged 1 commit into
Pedro Henrique Penna (ppenna) merged 1 commit into
Conversation
The artifact modules, the snapshot key and PreparedLaunch stay after the slimming, but they named ArtifactIdentity, RuntimeIdentity, MAX_IDENTITY_LEN and Inherited through host::store and host::supervisor, which only re-export them and which later PRs delete. Each import now names the module that owns the type: host::runtime for the identities, and host::platform::inherit for Inherited. The types are the same, so artifact discovery, identity comparison, snapshot keys and prepared launches behave as before, and the public API does not change. The artifact tests, and the snapshot tests' builders, through which the snapshot-key tests build their identities, import the identities from host::runtime too. Copilot-Session: 1b7e900c-27be-4ae2-9d4b-a912e7dac394 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
This pull request changes existing testsIt modifies or removes 2 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: 0; added: 0. Compared the merge base |
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are recorded for the import-path cleanup supporting the planned store and supervisor removal.
No open issues 🎉
What changed in this PR
This PR prepares retained host code for the planned store and supervisor removal in #1120 by importing types directly from their low-level owners. The changes are limited to imports; runtime behavior and the public API remain unchanged.
Changes:
- Import artifact and snapshot identities from
host::runtime. - Import
PreparedLaunch’s inherited-handle type fromhost::platform::inherit. - Update two test modules to use the retained identity paths without changing test logic.
| File | Description |
|---|---|
nvx-rs/src/host/snapshot/tests.rs |
Imports test identity types from host::runtime. |
nvx-rs/src/host/snapshot/key.rs |
Imports identities and their length limit from host::runtime. |
nvx-rs/src/host/sandbox/prepared.rs |
Imports Inherited directly from the platform layer. |
nvx-rs/src/host/artifacts/tests.rs |
Imports ArtifactIdentity from host::runtime. |
nvx-rs/src/host/artifacts/mod.rs |
Uses the retained runtime identity path. |
nvx-rs/src/host/artifacts/identity.rs |
Uses the retained artifact identity path. |
nvx-rs/src/host/artifacts/dir.rs |
Imports both identity types from host::runtime. |
Review effort: Balanced
Pedro Henrique Penna (ppenna)
merged commit Nov 11, 2026
d40228b
into
feature/nvx-refactor
47 checks passed
Pedro Henrique Penna (ppenna)
deleted the
agents/slim-sl6-0b-retained-imports
branch
November 11, 2026 09:12
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.
Part of #1120 (SL6.0b, "Retained modules no longer import legacy identity or handle paths"). Parent #1087, umbrella #1076.
What and why
The artifact modules, the snapshot key and
PreparedLaunchstay after the slimming, but they named their identity and inherited-handle types throughhost::storeandhost::supervisor, which only re-export them and which #1121 deletes. Each import now names the module that owns the type:nvx-rs/src/host/artifacts/mod.rshost::store::RuntimeIdentityhost::runtime::RuntimeIdentitynvx-rs/src/host/artifacts/dir.rshost::store::{ArtifactIdentity, RuntimeIdentity}host::runtime::{ArtifactIdentity, RuntimeIdentity}nvx-rs/src/host/artifacts/identity.rshost::store::ArtifactIdentityhost::runtime::ArtifactIdentitynvx-rs/src/host/snapshot/key.rshost::store::{ArtifactIdentity, MAX_IDENTITY_LEN, RuntimeIdentity}host::runtime::{ArtifactIdentity, MAX_IDENTITY_LEN, RuntimeIdentity}nvx-rs/src/host/sandbox/prepared.rshost::supervisor::Inheritedhost::platform::inherit::InheritedThese are the same types:
host::storere-exports the identities thathost::runtimedefines, andhost::supervisorre-exportsInheritedfromhost::platform::inherit. So artifact discovery, identity comparison, snapshot-key construction and prepared launches behave as before, and the public API doesn't change:scripts/public_api.pyfinds both snapshots current.BOOT_CONTRACT_VERSIONandCONTROL_CONTRACT_REVISIONdon't change.The issue's Scope names the snapshot key at its old path,
host/template/key.rs, which SL2.12a (#1345) moved tohost/snapshot/key.rs.History: the first implementation
Enrique Saurez (@esaurez)'s first implementation is
esaurez/slim-4.2.1-sl6.0b-20261108(b9d3c3ae, checkpoint on #1120): one commit that changed the five production imports. This PR replays it as its only commit, with Enrique Saurez (@esaurez) as its author, and adds the two test imports that the slice's "Done when" needs: the artifact tests importedArtifactIdentityfromhost::store, and the snapshot tests' builders, through which the snapshot-key tests build their identities (artifact,network_class), imported both identities from it. The prepared-launch tests never importedInherited.Not in this PR
As the issue's "Not in this PR" says, the other users that still name these types through
host::storeorhost::supervisorkeep them until the PRs that delete or switch them: the CLI's sandbox module,host::instance, the old clone path and template store, the store's and supervisor's own code and tests, the integration tests and runtime adapter that test them, and theexternal-launchexample. The snapshot-key tests also still write a key withhost::store::files::write_private, a store file helper rather than an identity.Size
Measured against
feature/nvx-refactor35cedfdb: 5 core lines (estimate 30, stop 60) in 5 counted files, oneuseline each:host/artifacts/mod.rs,host/artifacts/dir.rs,host/artifacts/identity.rs,host/snapshot/key.rsandhost/sandbox/prepared.rs. The two test files don't count.Tests of the area
Every test is kept, unchanged; only the imports of two test modules change (see "Changes to existing tests" below).
Kept tests, by module
host::artifacts::tests(19):release_layout_names_the_guest_artifacts,repository_layout_is_detected_beside_the_guest_sources,the_directory_variable_accepts_a_repository_checkout,this_repository_uses_the_repository_layout,explicit_variables_win_and_must_be_complete,the_directory_variable_precedes_the_executable_directory,the_bundle_is_the_last_resort,incompatible_manifests_are_unavailable,repository_manifest_declares_the_supported_contract,guests_name_their_artifacts_as_nvx_py_does,a_checkout_holds_the_guest_artifacts_in_build,a_release_holds_the_guest_artifacts_in_guest,guest_artifacts_are_required_in_the_order_and_words_of_nvx_py,artifact_paths_serialize_every_guest_in_order,a_checkout_identifies_its_runtime_by_the_build_provenance_of_its_artifacts,a_release_identifies_its_runtime_by_its_checksum_list,metadata_that_is_not_a_regular_file_fails_at_once (cfg unix),located_artifacts_have_the_identity_of_their_directory,the_bundle_is_a_compatible_release (cfg feature = "bundled")host::snapshot::key::tests(20):each_part_of_the_key_changes_it,each_contract_version_changes_the_key,a_generations_own_metadata_leaves_the_key_as_it_is,the_guest_build_is_not_part_of_a_snapshot_key,complete_capture_time_round_trips_without_changing_compatibility_identity,canonical_keys_require_capture_time_and_a_known_host_clock,a_key_holds_what_its_capture_made,a_capture_that_does_not_match_its_class_is_refused,a_class_selects_a_profile_as_openvmm_does,invalid_classes_are_refused,each_field_of_a_class_changes_its_identity,keys_read_back_from_their_canonical_encoding,keys_with_the_removed_guest_build_field_are_refused,snapshot_open_refuses_other_key_contracts_and_filesystem_tags (cfg any(target_os = "linux", windows)),other_encodings_of_a_key_are_refused,a_key_that_holds_its_network_s_lowering_after_its_invariants_is_refused,keys_of_machines_that_no_manifest_describes_are_refused,a_key_identity_is_the_identity_that_names_a_clones_template,identities_have_a_text_form,the_conformance_vectors_decode_and_encodehost::sandbox::prepared::tests(10):prepared_launches_hand_the_vmm_the_checked_files,an_upper_in_ram_takes_no_scratch_image,gpt_disks_are_prepared_from_their_bindings,prepared_launches_take_only_the_checked_files_of_their_plan,prepared_launches_refuse_final_paths_that_openvmm_cannot_take (cfg windows),prepared_launches_accept_balanced_brackets_in_final_paths (cfg windows),a_release_through_a_process_that_inherited_nothing_closes_none_of_its_handles (cfg windows),staging_checking_and_preparing_a_launch_read_no_content,no_plan_encodes_root_as_the_workload_identity,an_adapter_s_launch_renders_complete_arguments_that_fit_a_command_linehost::snapshot::tests(40):snapshot_open_checks_the_complete_directory_and_preserves_its_metadata,snapshot_open_refuses_every_missing_entry,snapshot_open_refuses_extra_entries_and_alternate_names,snapshot_open_refuses_every_directory_in_place_of_a_regular_file,snapshot_open_refuses_files_in_place_of_its_directories,snapshot_open_refuses_both_artifact_length_mismatches,snapshot_open_uses_the_strict_manifest_and_bounded_key_decoders,snapshot_open_refuses_a_key_from_another_manifest_machine,snapshot_description_contents_do_not_affect_opening,snapshot_open_refuses_a_compatible_key_with_another_capture_time,snapshot_open_refuses_every_shared_file_and_both_shared_directories (cfg target_os = "linux"),snapshot_open_refuses_entries_owned_by_another_user (cfg target_os = "linux"),snapshot_open_refuses_file_links_fifos_and_sockets_without_reading_them (cfg target_os = "linux"),snapshot_open_refuses_directory_links_even_with_trailing_separators (cfg target_os = "linux"),snapshot_description_needs_no_read_permission (cfg target_os = "linux"),snapshot_open_refuses_every_shared_file_and_both_shared_directory_acls (cfg windows),snapshot_open_refuses_directory_junctions_and_every_reparse_file_entry (cfg windows),snapshot_description_needs_no_data_read_access (cfg windows),a_restore_view_hard_links_only_the_fixed_openvmm_inventory,partial_restore_links_report_the_original_error_and_only_created_entries,snapshot_accepts_matching_real_disk_geometry_and_every_resource_boundary,snapshot_accepts_refuses_a_blockless_root_and_each_processor_mismatch,snapshot_accepts_treats_zero_boot_processors_as_all_capacity_online,snapshot_accepts_refuses_each_memory_mismatch_without_rounding_or_overflow,snapshot_accepts_reports_missing_image_and_scratch_files_as_io,snapshot_accepts_refuses_an_image_longer_than_its_placeholder,snapshot_accepts_refuses_each_image_block_size_mismatch,snapshot_accepts_refuses_each_scratch_geometry_mismatch,snapshot_accepts_refuses_both_nic_presence_mismatches_and_each_named_address_mismatch,snapshot_accepts_inherits_the_captured_address_and_does_not_compare_policies,snapshot_nic_returns_only_the_captured_presence_and_address_without_rereading,snapshot_open_refuses_captured_network_gateway_and_broadcast_addresses_as_io,snapshot_accepts_requires_the_boot_console_attachment_not_the_control_listener_or_device,snapshot_accepts_refuses_missing_and_unknown_boot_console_policies,snapshot_accepts_refuses_a_different_backend_and_each_cpu_profile_mismatch,snapshot_accepts_the_default_auto_and_matching_host_cpu_profile_requests,snapshot_accepts_refuses_nonregular_disks_without_waiting_for_a_fifo_writer (cfg target_os = "linux"),snapshot_accepts_refuses_every_runtime_identity_part_independently,snapshot_accepts_reports_early_and_expired_time_as_unavailable,snapshot_accepts_never_reopens_snapshot_paths_or_reads_runtime_artifactsValidation
feature/nvx-refactorhas noscripts/local_gates.py, sodev's copy, with--files, selected the gates, which ran with this branch's own action commands and pinned toolchain (1.95.0; MSRV 1.89), on Windows locally and on Linux onnvx-kvm-test(KVM, virtual machine, Azure Linux 3). The full matrix ran on929bb2e8, based on5947e4e8. The branch was then rebased onto8b775211(SL2.16) and onto35cedfdb(after #1460 and SL4.3), without conflicts, andgit range-diffshows the same patch each time. Of the changed files, onlyhost/snapshot/tests.rschanged in those base commits, where SL2.16 added two restore-view tests and their fixture, away from its imports. On the head49ea109f, these passed again on Windows:cargo fmt --all --check;cargo clippy -p nvx --lib --no-default-features -- -D warningsand the five Clippy runs of the Lint step;cargo test --locked --lib -- host::artifacts host::snapshot host::sandbox::prepared(126 passed) and the same with--all-features(130 passed);cargo doc --all-featureswith-D warnings;check_test_layout.py;check_test_changes.py; andpublic_api.py.929bb2e8cargo fmt --all --check-D warnings, the five feature sets of the Lint stepcargo test --locked --all-featuresguest::*failures, belowcargo test --lockedcargo buildandcargo test --lib,--no-default-features--features bundled artifactson a synthetic releasecargo doc --all-featureswith-D warningsscripts/public_api.py(both snapshots)cargo +1.89 check --all-targets --all-featurescargo check --target aarch64-apple-darwinnvx.py check-guest-binariesguest::*failures, belownvx.py build-guest-binaries,test-guest-binariescheck_test_layout.py,check_markdown_links.pyEvery failure also fails at the base on the same host:
host::cli::snapshots::capture::tests::a_capture_ack_and_successful_output_without_timely_exit_are_stopped_but_never_finished,host::template::clone::tests::restore::the_restore_to_ready_deadline_runs_from_the_launch_through_every_step,host::platform::windows::tests::children_inherit_only_their_standard_handles, andhost::vm::tests::an_unrelated_process_started_in_the_library_spawn_window_gets_no_vm_claim. Run alone, the last three pass at both, and the first fails 1 run in 3 at the head and 1 in 5 at the base. The default-feature unit-test binaries of the two revisions differ in 285 of 23.9 M bytes: the PE header and panic line numbers. With--no-fail-fast, every integration test and doctest passes.--all-features, the same 28 tests ofguest::{entry, exec, init, managed_agent}fail at both revisions, and the guest musl suite ofcheck-guest-binariesfails the same 26 at both. These tests reach none of the changed modules, which the guest build doesn't compile.No microVM scenario ran: the change renames imports of the same types and changes no runtime behavior. CI runs the selected hypervisor suites on KVM, MSHV and WHP.
Changes to existing tests
python3 scripts/check_test_changes.py --base origin/feature/nvx-refactorlists two changes, both imports, hence thetests-modifiedlabel:host::artifacts::tests(nvx-rs/src/host/artifacts/tests.rs) importsArtifactIdentityfromhost::runtimeinstead ofhost::store. It's the same type, and no test changes.host::snapshot::tests(nvx-rs/src/host/snapshot/tests.rs) importsArtifactIdentityandRuntimeIdentityfromhost::runtimeinstead ofhost::store, in its existinghost::runtimeimport. They're the same types, and no test or builder changes.The
openvmmgitlink doesn't move.