Repository navigation
host: delete the sandbox store, the instance layer and the supervision (SL6.1) - #1520
Conversation
This pull request changes existing testsIt modifies or removes 345 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 285 more, which the job's summary lists. Test data
Relocated unchanged: 0; added: 1. Compared the merge base |
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues were identified for the removal of the legacy store and instance layers.
No open issues 🎉
What changed in this PR
Implements SL6.1 of the NVX library-slimming workstream: removes the sandbox store, instance layer, store-coupled supervision, and remaining store identities. Low-level VM spawning remains available through transitional exports. The supplied diff also includes prerequisite changes carried on the temporary stack.
Changes:
- Deletes obsolete persistence and supervision code, associated fixtures, and tests.
- Preserves retained VM mechanisms while making spawn locking crate-private and gating CLI-only platform helpers.
- Updates documentation, dependency assertions, and the acceptance matrix to reflect the removals.
| File | Description |
|---|---|
scripts/test_microvm_tests.py |
Updates simulated sandbox records to format 10. |
scripts/nvx_tools/sandbox_ram_upper_tests.py |
Expects configuration format 10. |
nvx-rs/tests/vectors/README.md |
Documents retained vector consumers after template removal. |
nvx-rs/tests/openvmm_vectors.rs |
Corrects documentation of allowlist-test ownership. |
nvx-rs/tests/managed_lifecycle.rs |
Removes instance references and generates test capabilities directly. |
nvx-rs/tests/host_modules.rs |
Checks retained module dependency edges. |
nvx-rs/tests/fixtures/store/runtime.json |
Deletes the legacy runtime-record fixture. |
nvx-rs/tests/fixtures/store/launch-spawned.json |
Deletes the spawned-launch fixture. |
nvx-rs/tests/fixtures/store/launch-prepared.json |
Deletes the prepared-launch fixture. |
nvx-rs/tests/fixtures/store/invalid/runtime-unknown-field.json |
Deletes the unknown-field rejection fixture. |
nvx-rs/tests/fixtures/store/invalid/runtime-truncated.json |
Deletes the truncated-record fixture. |
nvx-rs/tests/fixtures/store/invalid/runtime-instance-format-3.json |
Deletes the old instance-runtime fixture. |
nvx-rs/tests/fixtures/store/invalid/runtime-format-5.json |
Deletes the unsupported runtime-format fixture. |
nvx-rs/tests/fixtures/store/invalid/runtime-cli-format-1.json |
Deletes the old CLI-runtime fixture. |
nvx-rs/tests/fixtures/store/invalid/launch-without-log.json |
Deletes the missing-log launch fixture. |
nvx-rs/tests/fixtures/store/invalid/launch-instance-format-3.json |
Deletes the old instance-launch fixture. |
nvx-rs/tests/cli/formats.rs |
Tests format 10 and rejection of earlier configurations. |
nvx-rs/src/host/vm/tests.rs |
Gates the Windows claim-query test by cli. |
nvx-rs/src/host/vm.rs |
Takes ownership of private capability generation. |
nvx-rs/src/host/vm_directory/tests.rs |
Removes obsolete checks and gates CLI-only assertions. |
nvx-rs/src/host/transport/tests.rs |
Names test pipes without store identities. |
nvx-rs/src/host/tests.rs |
Adds random test suffixes and gates shared wait helpers. |
nvx-rs/src/host/template/clone/record.rs |
Deletes legacy clone activation-record construction. |
nvx-rs/src/host/template/clone/launch/tests.rs |
Deletes the obsolete clone-launch test hook. |
nvx-rs/src/host/sys/mod.rs |
Gates Linux rename support by cli. |
nvx-rs/src/host/store/vmm.rs |
Deletes store-managed process recovery helpers. |
nvx-rs/src/host/store/regular.rs |
Deletes obsolete store file-reading adapters. |
nvx-rs/src/host/spawn.rs |
Removes store-coupled guidance from spawn documentation. |
nvx-rs/src/host/snapshot/tests.rs |
Uses retained platform and VM-directory helpers. |
nvx-rs/src/host/snapshot/manifest.rs |
Removes the private template-manifest alias. |
nvx-rs/src/host/snapshot/key/tests.rs |
Removes deleted identity, alias, and helper checks. |
nvx-rs/src/host/snapshot/key.rs |
Removes store-identity conversions and obsolete helpers. |
nvx-rs/src/host/snapshot/capture.rs |
Uses platform file helpers directly. |
nvx-rs/src/host/snapshot.rs |
Removes an unused capture-helper re-export. |
nvx-rs/src/host/seal/windows/tests.rs |
Retires the removed volume-path helper’s test. |
nvx-rs/src/host/seal/windows.rs |
Deletes volume-GUID path support used by removed code. |
nvx-rs/src/host/seal.rs |
Removes the private volume-path wrapper. |
nvx-rs/src/host/sandbox/scratch.rs |
Removes a dead accessor and obsolete documentation reference. |
nvx-rs/src/host/sandbox/prepared.rs |
Documents process ownership without Starting. |
nvx-rs/src/host/sandbox/plan.rs |
Deletes the unused legacy DNS helper. |
nvx-rs/src/host/sandbox/geometry.rs |
Removes documentation of the deleted template re-export. |
nvx-rs/src/host/sandbox/distro.rs |
Removes a dead accessor and obsolete documentation reference. |
nvx-rs/src/host/runtime/mod.rs |
Documents runtime identity through caller-owned saved VMs. |
nvx-rs/src/host/restore/tests/live_init.rs |
Uses snapshot metadata and directly generated capabilities. |
nvx-rs/src/host/platform/windows/private/tests.rs |
Gates CLI-only directory and rename checks. |
nvx-rs/src/host/platform/windows/mod.rs |
Removes obsolete exports and gates CLI-only helpers. |
nvx-rs/src/host/platform/windows/log_claim.rs |
Gates claim queries while retaining spawn job support. |
nvx-rs/src/host/platform/windows/endpoint/tests.rs |
Replaces store-based names and gates endpoint-owner tests. |
nvx-rs/src/host/platform/windows/endpoint.rs |
Deletes obsolete endpoint helpers and gates owner lookup. |
nvx-rs/src/host/platform/tests.rs |
Covers retained file helpers and adjusts feature-specific tests. |
nvx-rs/src/host/platform/other.rs |
Removes obsolete stubs and gates CLI-only primitives. |
nvx-rs/src/host/platform/linux/tests.rs |
Uses retained endpoint APIs and matching feature gates. |
nvx-rs/src/host/platform/linux/private.rs |
Removes unused privacy helpers and gates CLI operations. |
nvx-rs/src/host/platform/linux/mod.rs |
Gates log claims and removes obsolete re-exports. |
nvx-rs/src/host/platform/linux/endpoint.rs |
Removes legacy endpoint wrappers and retains verified receive. |
nvx-rs/src/host/platform/inherit.rs |
Makes spawn locking crate-private and updates inheritance guidance. |
nvx-rs/src/host/mod.rs |
Removes deleted modules and updates host-layer documentation. |
nvx-rs/src/host/instance/files.rs |
Deletes instance-owned persistence helpers. |
nvx-rs/src/host/cli/store/tests.rs |
Retires interoperability checks with the deleted library store. |
nvx-rs/src/host/cli/store/mod.rs |
Removes documentation of shared library-store locking. |
nvx-rs/src/host/cli/store/files.rs |
Routes persistence through platform helpers. |
nvx-rs/src/host/cli/snapshots/tests.rs |
Uses the retained private-write helper. |
nvx-rs/src/host/cli/snapshots/capture/tests.rs |
Creates capture fixtures through platform helpers. |
nvx-rs/src/host/cli/snapshots/capture.rs |
Creates geometry files without the old store. |
nvx-rs/src/host/cli/snapshots.rs |
Syncs snapshot publication through platform helpers. |
nvx-rs/src/host/cli/sandbox/state/tests.rs |
Builds records without legacy launch objects. |
nvx-rs/src/host/cli/sandbox/options.rs |
Produces NetworkConfig instead of legacy sandbox networking. |
nvx-rs/src/host/cli/sandbox/lifecycle/tests.rs |
Uses the CLI-owned stop outcome. |
nvx-rs/src/host/cli/sandbox/lifecycle/stop.rs |
Defines the CLI’s private stop-outcome type. |
nvx-rs/src/host/cli/sandbox/lifecycle/start/tests/restore.rs |
Updates restore fixtures to CLI-owned configuration. |
nvx-rs/src/host/cli/sandbox/lifecycle/start/tests.rs |
Tests launch checks without legacy launch objects. |
nvx-rs/src/host/cli/sandbox/lifecycle/mod.rs |
Provisions from explicit images and CLI record options. |
nvx-rs/src/host/cli/sandbox/lifecycle/directory.rs |
Creates state directories through the CLI’s own store. |
nvx-rs/src/host/cli/run.rs |
Consumes NetworkConfig directly. |
nvx-rs/src/contract.rs |
Documents the snapshot key’s retained public path. |
nvx-rs/src/activation/tests.rs |
Retires checks for deleted store identities. |
nvx-rs/src/activation/mod.rs |
Deletes Identity, StoreGeneration, and TemplateReference. |
nvx-rs/Cargo.toml |
Updates the host-feature comment; feature behavior is unchanged. |
doc/run.md |
Documents format 10 and CLI-owned store rules. |
doc/project-structure.md |
Updates the crate and test-layout descriptions. |
doc/design/5.3-snapshot-protocol.md |
Removes the template store’s capture-deadline example. |
doc/design/1.5-compatibility-and-versioning-model.md |
Describes key compatibility without the deleted template store. |
doc/acceptance-case-matrix.md |
Records retired and rewritten examples and updated test references. |
Review effort: Balanced
With the old clone path and the template store gone (SL6.2b, SL6.2a), and the code that stays off them (SL6.0a to SL6.0e), nothing uses the sandbox store, the instance layer that ran a VM in a store of its own, or the supervisor's store-coupled launch, wait, stop and reattach. host::instance and host::store leave whole, and host::supervisor loses launch, reattach, Vmm, Starting, Reattached, StopOutcome and Stopped, with its public SpawnLock and lock_spawns, which become crate-private in host::platform::inherit for host::vm::spawn's lock. The last store identity types, activation::Identity, StoreGeneration and TemplateReference, leave with the snapshot key's conversions to and from Identity. The public API snapshots lose 236 items on each platform. host::supervisor stays, with no code of its own, as the transitional public path of the low-level spawn items that code which stays uses: it re-exports spawn, spawn_vm, VmmCommand, Launched, Inherited and spawn_command. The external-launch example, which launches a caller's vm::VmmCommand with supervisor::spawn_vm (b2a70a3, 2026-11-10), checked_handoff's tests and PreparedLaunch's doc test came after the plan of #1121, which deletes the whole module. SL6.3 (#1122) deletes spawn_command and the checked-file handoff, and settles the example's launcher; the module says so. The crate-private code that only the store, the instance and the supervision used leaves with them, as the dead-code check of each feature set finds it on Linux and Windows: platform::control_endpoint and endpoint_server_pid on every host, and Directory's open_file, search, search_dir and open_dir, with Linux's open_dir_with. What only the CLI's own store uses now is gated by its cli feature on every host: endpoint_server_pid_until, is_deleted, file_id, opened_file_id, opened_file_identity, Directory, and the log claim's claim_log, log_claim_held and serves_launch, with Linux's log_claim module and restore_private_file_mode, and Windows' log_job_processes, check_store_dir and delete_opened, and its re-exports of opened_file_id and create_store_dir, which its own VM directories still use; the handle that a log job's name holds expects to be dead without cli, since only the CLI's claim checks query it. The tests of what leaves go with it: tests/store.rs, with the store's record fixtures, and tests/fake_openvmm.rs, the instance's cases; the cases of tests/supervisor.rs that launch, reattach to or stop a VMM through a sandbox store, with their orchestrator fixture; the store's, the instance's and the supervisor's unit tests; the store and supervisor doc tests; StoreGeneration's and the key identity's conversion tests; the Windows test of a store launch whose VMM exited; and the CLI store's test that it shares the sandbox store's lock and file names. The cases of tests/supervisor.rs that test what stays, host::process and the low-level spawn that host::supervisor still exports, stay unchanged, but for two that drop their checks of what leaves: one no longer checks that a Vmm is Send and Sync, and one no longer reattaches a sandbox to the process that it may not query. Two activation tests drop their checks of Identity, and the host-module test checks the edges vm -> spawn, supervisor -> spawn and spawn -> platform in place of those to the store. The tests of what the cli feature now gates are gated with it, two of them calling endpoint_server_pid_until where they called endpoint_server_pid; the Windows tests name their pipes with a random suffix of their own in place of a LaunchId or control_endpoint, and the snapshot fixture and the CLI's Windows lifecycle test create their private directories with vm::create_private_dir. The docs stop naming what left: the crate's example, now a cold boot and a stop through host::vm, and its module list; the host module's; the runtime, spawn, process-inheritance, prepared-launch and CLI-store rustdoc; Cargo.toml's host feature; the nvx README's layout, module table, runtime, VM, snapshot, supervisor, launch, CLI sandbox, state directory, example, error and test sections; and the store rules of doc/run.md and the crate's summary in doc/project-structure.md. The case matrix retires the store's and the supervisor's doc tests and rewrites the crate's. Part of #1121 (SL6.1). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
5bffcd7 to
ba716d4
Compare
baf560d
into
feature/nvx-refactor
Leaving code only. This PR changes only code that this effort removes from NVX: the sandbox store (
host::store), the instance layer (host::instance), the supervisor's store-coupled launch, wait, stop and reattach, and the last store identities,activation::Identity,StoreGenerationandTemplateReference, with the crate-private code that only they used and 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.Beyond what leaves, the modules that it edits only lose crate-private items that only the deleted code used, as the compiler's dead-code check finds them. They also gate by
cliwhat only the CLI's own store uses now, and makeSpawnLockandlock_spawnscrate-private forhost::vm::spawn's lock, with the rustdoc, README and test assertions that named them. Those modules arehost::platform,host::snapshot,host::runtime,host::sandbox,host::spawn,host::cliandactivation.host::supervisorstays as a transitional re-export, below.Part of #1121 (SL6.1, "The sandbox store and its supervisor are gone"). Parent #1087, umbrella #1076.
Rebased on
feature/nvx-refactorata732c108, where every PR that it needed has merged: #1507 (SL6.2b), #1513 (SL6.2a), #1501 (SL3.10c), #1503 (SL3.10d), #1518 (SL6.0d) and #1519 (SL6.0e). It is one commit,ba716d48.What and why
With the old clone path and the template store gone (SL6.2b, SL6.2a), and the code that stays off them (SL6.0a to SL6.0e), nothing uses the sandbox store, the instance layer that ran a VM in a store of its own, or the supervisor's store-coupled launch, wait, stop and reattach. This PR does SL6.1's Scope, in one commit:
host::instanceandhost::storego whole:nvx-rs/src/host/instance/(Instance,Found,Running,Started,Stopped,WorkloadOutcome, its files and locked state) andnvx-rs/src/host/store/(SandboxStore,LockedStore,LaunchId, the runtime and launch records, the caller's files, the store's names, leases, locks and lifecycle), with theirtests.rsfiles.host::supervisorloses all supervision:launch.rs,reattach.rs,vmm.rsandtests.rs, withlaunch,Starting,reattach,Reattached,Vmm,StopOutcomeandStopped. The publicSpawnLockandlock_spawnsbecome crate-private inhost::platform::inherit, wherehost::vm::spawn's private lock andspawn_commandstill take them.The last store identities go:
activation::Identity,StoreGenerationandTemplateReference, with the snapshot key's conversions betweenKeyIdentityandactivation::Identity.The public API snapshots lose 236 items on each platform: 129 of
host::store, 60 ofhost::instance, 37 ofhost::supervisorand 10 ofactivation. None is added.The crate-private code that only the store, the instance and the supervision used goes with them, as the dead-code check of CI's warning-denied builds of each feature set finds it on Linux and Windows. That is
platform::control_endpointandendpoint_server_pidon every host, andDirectory'sopen_file,search,search_dirandopen_dir, with Linux'sopen_dir_with.What only the CLI's own store uses now is gated by
clion every host, as nvx-rs slimming workstream: makenvxa library of mechanisms and value types #1076's rule for crate-private items gated "by the features of their users" asks and as SL6.2a did forrename_no_replace:endpoint_server_pid_until,is_deleted,file_id,opened_file_id,opened_file_identity,Directory, and the log claim'sclaim_log,log_claim_heldandserves_launch;log_claimmodule andrestore_private_file_mode;log_job_processes,check_store_diranddelete_opened, and its re-exports ofopened_file_idandcreate_store_dir, whose functions its own VM directories and log jobs still use;LogJobName::Users) expects to be dead withoutcli, since only the CLI's claim checks query the job's processes.vm::spawn's support, the log claims ofplatform/{linux,windows}/log_claim.rsand the private spawn lock don't change.The docs stop naming what left:
host::vm, and its module list; thehostmodule's; and the docs of the runtime, the spawn, the process inheritance,PreparedLaunchand the CLI's store;Cargo.toml's comment on thehostfeature;nvx-rs/README.md: the layout, the module table (the rows ofhost::storeandhost::instancego, andhost::supervisor's says what is left), the runtime, VM, snapshot, supervisor, launch, CLI-sandbox and state-directory sections, the example, the errors and the tests. The sections ofnvx::host::storeandnvx::host::instancego;doc/run.md's sandbox-store rules anddoc/project-structure.md's crate summary.The case matrix retires the doc tests
nvx-rs/src/host/store/mod.rs - host::store (line 72),(line 104)andnvx-rs/src/host/supervisor/mod.rs - host::supervisor (line 32). It rewritesnvx-rs/src/lib.rs - (line 58)asnvx-rs/src/lib.rs - (line 61), the cold boot and stop throughhost::vm, and turns its row from kept to rewritten, as the orchestrator decided for Pedro Henrique Penna (@ppenna). The README's Example row notes the same, and the Docs summary now counts 36 doc tests: 28 kept, 2 rewritten, 6 retired.Deviation from #1121:
host::supervisorstays as a transitional re-export#1121's Scope deletes
host/supervisor/whole, withtests/supervisor.rs. But code that stays came to use the low-level spawn items, which are public only throughhost::supervisor, after the plan was written:nvx-rs/examples/external-launch.rs(b2a70a3a, 2026-11-10) launches a caller'svm::VmmCommandwithsupervisor::spawn_vm, andtests/checked_handoff.rsand the doc test ofPreparedLaunchspawn through it too. As the orchestrator decided for Pedro Henrique Penna (@ppenna), and as it records on #1121 and #1122,nvx-rs/src/host/supervisor/mod.rsstays only as the transitional public path of these items. It re-exportsspawn,spawn_vm,VmmCommand,Launched,Inheritedandspawn_command, has no code of its own, and supervises nothing. Its module doc says so, and names SL6.3 (#1122), which deletesspawn_commandand the checked-file handoff and settles the example's launcher. This keeps the Approach's intent, no supervision facade. It adds no public API and changes no code that stays.For the same reason,
tests/supervisor.rskeeps the cases of what stays, as #1121's Tests ask ("Each PR retires the tests of what it deletes. … Every other test passes unchanged"). Its cases ofhost::processand of the low-level spawn thathost::supervisorstill exports stay unchanged:host::process;They are the only tests that spawn with
breakaway_from_jobor check the 258-unit working directory, which a code review flagged. Its cases of a launch through a sandbox store, with their orchestrator fixture, retire (below). The orchestrator may prefer to retire the whole file, as the Scope's wording says: that is one commit away.Every removed test, and its fate
python scripts/check_test_changes.py --base origin/feature/nvx-refactorreports 345 changes to existing tests. They are 143 removed tests, 21 modified tests, 16 modified helpers, the imports of 8 test modules, and the removed helpers, modules, imports and attributes of the deleted test files, with the 10 record fixtures oftests/fixtures/store/. All 143 removed tests retire, since what they check leaves NVX. None is named in the case matrix, as coverage or otherwise (git grepof each name):host::store::tests,host::store::caller::tests,host::store::lifecycle::testsand its Windows module), the instance (8) and the supervisor's launch, reattach, wait and stop (24), and the 17 cases oftests/store.rs;tests/fake_openvmm.rs, the instance's integration cases. The fake OpenVMM's own cases moved totests/fake_openvmm_behavior.rsin nvx-rs slimming 4.2.1: the code that stays stops using what leaves #1120 and stay;tests/supervisor.rsthat launch, reattach to or stop a VMM through a sandbox store, with theirorchestrator_fixture.long_stores_launch_with_a_short_working_directorylaunched through a store whose path is too long for a working directory, andworking_directory_limits_include_trailing_separatorskeeps checking the limit of the spawn.a_vmm_that_breaks_away_survives_its_orchestrators_jobanda_vmm_in_its_orchestrators_job_ends_with_itreattached through the store, anda_restarted_launcher_finds_its_vmm_again_and_ends_itanda_job_that_ends_its_vmm_wakes_the_waiterskeep checking both behaviors of the spawn;activation::tests::a_store_generation_is_a_nonzero_number_in_the_order_of_publication, the test ofStoreGeneration;host::snapshot::key::tests::a_key_identity_is_the_identity_that_names_a_clones_template, the test ofKeyIdentity's conversions to and fromactivation::Identity;host::cli::store::tests::the_lock_and_the_files_are_those_of_the_sandbox_store_of_nvx, which checked that the CLI's store shares the sandbox store's lock and file names; the CLI's store keeps them;host::platform::windows::tests::a_launch_whose_vmm_exited_ends_while_a_process_spawned_in_its_window_holds_its_log, which launched through the store.The doc tests
nvx-rs/src/host/store/mod.rs - host::store (line 72),(line 104)andnvx-rs/src/host/supervisor/mod.rs - host::supervisor (line 32), which the report doesn't list, retire too, andnvx-rs/src/lib.rs - (line 58)becomes(line 61), as the case matrix's Docs rows say.nvx-rs/src/activation/tests.rs(activation::tests): 1a_store_generation_is_a_nonzero_number_in_the_order_of_publicationnvx-rs/src/host/cli/store/tests.rs(host::cli::store::tests): 1the_lock_and_the_files_are_those_of_the_sandbox_store_of_nvxnvx-rs/src/host/instance/tests.rs(host::instance::tests): 3interrupted_writes_leave_temporary_files_that_only_their_removal_takes,readiness_failures_explain_images_without_workload_accounts,session_failures_have_the_codes_of_their_kinds_but_a_closed_endpointnvx-rs/src/host/instance/tests.rs(host::instance::tests::store): 5instances_that_record_no_vm_need_no_runtime_identity,stopped_instances_are_removed_with_the_callers_files,records_of_the_earlier_format_fail_naming_it,launches_are_checked_before_the_instance_exists,working_directory_limits_are_checked_before_instance_launchesnvx-rs/src/host/platform/windows/tests.rs(host::platform::windows::tests): 1a_launch_whose_vmm_exited_ends_while_a_process_spawned_in_its_window_holds_its_lognvx-rs/src/host/snapshot/key/tests.rs(host::snapshot::key::tests): 1a_key_identity_is_the_identity_that_names_a_clones_templatenvx-rs/src/host/store/caller/tests.rs(host::store::caller::tests): 6declarations_keep_their_names,names_that_leave_the_directory_are_refused_on_every_host,names_that_a_file_system_could_take_for_others_are_refused,names_that_collide_are_refused_whatever_their_case,store_temporaries_name_one_of_the_stores_files_and_a_number,report_staging_files_have_the_names_that_tempfile_gives_themnvx-rs/src/host/store/lifecycle/tests.rs(host::store::lifecycle::tests): 29transition_role,lifecycle_locks_exclude_other_holders_until_released,released_locks_leave_no_lock_file_in_unprovisioned_directories,a_holder_removes_only_its_own_lock_file_on_release,directories_that_others_may_access_are_refused,stale_directories_hold_no_sandbox_and_keep_no_lock_file,a_removal_removes_the_store_the_callers_files_and_the_directory,a_removal_refuses_foreign_entries_and_keeps_them,a_removal_is_refused_while_a_vm_or_a_launch_is_recorded,a_removal_makes_the_absence_of_the_clones_files_durable_before_it_removes_anything_else,a_removal_that_cannot_make_the_absence_of_the_clones_files_durable_keeps_the_sandbox,a_removal_unbinds_the_sandbox_whose_lock_it_holds_whatever_its_path_names_meanwhile,a_removal_through_a_path_that_names_another_sandbox_meanwhile_removes_nothing,lingering_lock_files_keep_the_directory_until_they_go,a_lingering_removal_reports_what_appears_in_the_directory,a_lingering_removal_finds_the_configuration_record_by_its_path,a_removal_that_another_finishes_succeeds_and_keeps_what_replaced_the_directory,a_lingering_removal_keeps_an_empty_directory_that_replaced_its_own,only_the_directory_that_the_path_still_names_is_removed,directories_are_identified_as_their_seals_identify_them,a_removal_needs_the_configuration_record,a_provision_creates_again_a_directory_that_a_removal_deletes_while_it_is_created,locks_whose_lock_file_keeps_being_replaced_keep_their_deadline,a_provision_that_waits_through_a_removal_provisions_the_sandbox_again,transitions_that_wait_through_a_removal_find_the_sandbox_gone,a_transition_that_waits_for_a_holder_that_provisions_nothing_finds_no_sandbox,transitions_in_other_processes_that_wait_through_a_removal_find_the_sandbox_gone,provisions_in_other_processes_that_race_a_removal_provision_the_sandbox_again,refused_removals_keep_the_directory_for_transitions_in_other_processesnvx-rs/src/host/store/lifecycle/tests.rs(host::store::lifecycle::tests::windows): 7locks_wait_for_a_removed_lock_file_that_a_handle_keeps,provisions_wait_for_a_removed_directory_that_a_handle_keeps,a_removal_takes_a_binding_whose_deletion_is_pending_for_removed_and_waits_until_it_goes,a_removal_takes_the_clone_files_whose_deletion_is_pending_for_removed,locks_refuse_a_lock_file_that_refuses_access_for_good,a_transition_whose_lock_file_lingers_waits_until_it_goes,transitions_in_other_processes_wait_for_a_lingering_lock_filenvx-rs/src/host/store/tests.rs(host::store::tests): 24records_keep_their_json_form,records_of_other_formats_fail_clearly,records_with_invalid_fields_are_malformed,the_lock_excludes_other_holders,a_lock_file_replaced_while_waiting_locks_nothing,a_lock_file_that_is_not_a_regular_file_fails_at_once,a_lock_file_that_is_a_link_fails_at_once,records_and_capabilities_that_are_not_regular_files_fail_at_once,entries_that_are_links_or_not_regular_files_are_refused_as_the_platform_refuses_them,failures_to_read_the_records_and_the_capability_name_them,the_store_is_private_to_the_current_user,stores_belong_to_the_current_user_with_mode_700,the_store_is_private_to_the_current_user,a_caller_that_keeps_the_console_keeps_it_across_launches,stores_open_only_existing_directories,a_launch_writes_its_marker_before_its_vmm_runs,launches_check_their_inputs,an_abandoned_launch_that_spawned_nothing_has_exited,a_recorded_vmm_that_cannot_be_held_has_exited_once_its_log_is_released,a_journal_that_its_runtime_record_supersedes_is_removed,report_staging_files_go_once_nothing_of_their_launch_runs,a_store_whose_directory_went_reports_it_missing_as_it_clears_a_runtime,launch_identities_are_fresh_hexadecimal,an_endpoint_server_counts_only_while_the_endpoint_names_it_once_heldnvx-rs/src/host/supervisor/tests.rs(host::supervisor::tests): 24a_vmm_that_heeds_the_graceful_step_stops_gracefully,without_the_forced_step_a_stop_times_out_and_never_signals,a_requested_forced_step_that_ends_the_vmm_reports_forced,a_failed_graceful_step_is_kept_and_not_waited_out,a_vmm_that_exited_already_skips_the_graceful_step,undetermined_states_and_failed_terminations_are_errors,a_termination_takes_the_forced_step_alone,terminations_whose_effect_cannot_be_determined_are_errors,a_sandbox_without_a_record_has_no_vm,a_live_vmm_of_the_same_runtime_is_held,a_live_vmm_of_another_runtime_is_mismatched,records_of_exited_vmms_are_cleared,a_vmm_that_cannot_be_examined_is_indeterminate_and_keeps_its_record,an_interrupted_launch_that_cannot_be_ended_is_indeterminate,reattach_refuses_an_invalid_runtime,stops_check_their_store_and_forced_bound_before_anything_else,a_launch_whose_command_fails_ends_before_anything_runs,a_launch_whose_caller_cannot_record_its_failure_keeps_its_journal_for_recovery,a_reattach_whose_caller_cannot_record_an_exit_keeps_the_record_until_one_can,a_launch_whose_vmm_cannot_start_ends,a_forced_teardown_that_fails_keeps_the_record_until_one_ends_the_vmm,only_a_stop_unless_exited_keeps_the_record_of_a_vmm_that_had_exited,a_stop_unless_exited_stops_a_running_vmm_as_a_stop_does,a_stop_keeps_the_record_of_another_vmm_under_the_same_launch_identitynvx-rs/tests/fake_openvmm.rs(fake_openvmm (tests)): 12instances_start_run_workloads_and_stop,timeouts_are_checked_before_they_are_used,launches_beyond_the_process_command_line_limit_are_refused,cancellation_ends_a_running_workload,unresponsive_guests_are_terminated,a_vm_whose_capability_is_lost_is_still_stopped,guests_without_required_features_are_refused,launches_that_exit_fail_to_start,orchestrator_role,a_restarted_orchestrator_reattaches_to_its_vm,outcome_reports_of_another_runtime_are_never_read,records_that_name_another_process_never_end_itnvx-rs/tests/store.rs(store (tests)): 17orchestrator_role,vmm_role,restrictive_umask_role,a_restrictive_umask_leaves_the_store_usable,a_crash_before_the_spawn_leaves_a_released_claim,the_log_claim_proves_that_an_unrecorded_vmm_exited,a_crash_before_the_endpoint_ends_the_recorded_vmm,recovery_never_signals_a_process_that_the_journal_does_not_name,a_committed_launch_names_its_vm_for_another_build,an_abandoned_launch_ends_its_recorded_vmm,an_unrecorded_vmm_is_verified_through_its_endpoint_and_log,an_endpoint_served_without_the_claimed_log_is_not_signaled,another_build_with_the_same_runtime_identity_reattaches,another_runtime_identity_is_mismatched,journals_of_each_launch_step_load,unsupported_and_corrupt_records_fail_clearly,a_dropped_lock_is_free_while_a_spawning_process_holds_its_descriptornvx-rs/tests/supervisor.rs(supervisor (tests)): 12orchestrator_fixture,long_stores_launch_with_a_short_working_directory,a_launch_that_crashes_before_its_spawn_is_ended_on_reattach,an_unrecorded_vmm_that_serves_no_endpoint_is_never_signaled,an_unrecorded_vmm_that_serves_its_endpoint_is_ended_on_reattach,a_launch_that_crashes_before_it_commits_ends_its_recorded_vmm_on_reattach,a_committed_vmm_outlives_its_orchestrator_and_stops_gracefully,a_vmm_of_another_runtime_is_ended_only_by_its_termination,records_of_reused_ids_and_earlier_boots_name_vmms_that_exited,a_vmm_that_breaks_away_survives_its_orchestrators_job,a_vmm_in_its_orchestrators_job_ends_with_it,a_vmm_of_another_runtime_that_cannot_be_terminated_keeps_its_recordSize
Measured against
a732c108, by #1076's rules:Core lines: 3 changed, 0 new. Each is a re-export list that loses a deleted item: the endpoint re-exports of
platform's Linux and Windows modules (control_endpoint,endpoint_server_pid), andhost::supervisor's re-export ofplatform::inherit(SpawnLock,lock_spawns). The other 97 added or changed code lines don't count. They are the 58 lines that gate items bycli, with the 7-linecfg_attrofLogJobName::Users; the 35 import and re-export lines that this gating forces; and the 2 that makeSpawnLockandlock_spawnscrate-private.Counted files: 16, where the estimate says 3. All of them only lose code, re-exports or doc references:
activation/mod.rs,host/mod.rs,host/snapshot/key.rsandhost/supervisor/mod.rs;host/platform/{linux/{endpoint,identity,mod},other,windows/{endpoint,identity,mod}}.rs;lib.rs,host/runtime/mod.rs,host/sandbox/prepared.rs,host/spawn.rsandhost/cli/store/mod.rs.host/platform/inherit.rs, which only makes items crate-private, andhost/platform/{linux,windows}/private.rsandwindows/log_claim.rs, which only gate items bycliwith the import edits that this forces, don't count. Neither do the 35 files that it only deletes.BOOT_CONTRACT_VERSIONandCONTROL_CONTRACT_REVISIONdon't change.Left as is
spawn_command,host::vm::spawn's private lock and the spawn support thatvm::spawnuses, and the log claims ofplatform/{linux,windows}/log_claim.rs, as SL6.1's Scope keeps them. SL6.3 (nvx-rs slimming 4.2.3: the old configs, the old launch code andbundledare gone #1122) deletesspawn_commandand the checked-file handoff.sandbox-leased, whose last producer, the sandbox store's refusal of a leased sandbox's launch, leaves. Its docs, and those offoreign-files, still name the template store: nvx-rs slimming 4.3.3: the error codes are private #1126 deletes the codes that nothing produces onceErrorCodebecomes crate-private, as SL6.2a lefttemplate-ineligibleandtemplate-tombstoned.doc/modules, the module diagrams, which still showhost::instance,host::storeand the supervisor's modules: CI's nightlymodule-diagramsworkflow draws them again.host::vmcreates, spawns, reattaches to and stops them.Not in this PR
Rewriting, refactoring or improving retained VM, platform or process code; re-homing the store, instance or supervisor APIs under new module names; replacement leases, identities, supervision or persistent host state; deleting
spawn_command(SL6.3); changing the private VM spawn lock or the platform log claims.Validation
Rebased on
a732c108asba716d48. The rebase applied without conflicts, and the commit's own changes are those of5bffcd7fbut for one line of context: #1523'sconnect_child_endpointinplatform::linux's re-exports of the CLI's endpoint functions. Onba716d48: locally on Windows,cargo fmt --all --check, Clippy-D warningswith--all-targets --all-features,--lib,--lib --bins --features cliand--lib --no-default-features, natively and for--target x86_64-unknown-linux-gnu,public_api.py,RUSTDOCFLAGS=-D warnings cargo docand SL5.2's matrix check passed. On nvx-mshv-test, with the CI artifacts and OpenVMM build of the tables below, every check of check-nvx-rs passed:cargo fmt --check; the six Clippy sets;cargo test --all-features(97 suites, 2359 tests, 66 ignored) andcargo test(16 suites, 974 tests, 18 ignored); the build and tests without default features (282); the bundled-artifact check (21);cargo docwith-D warnings;public_api.py; the MSRV and macOS checks;check-guest-binaries(91 suites, 1305 tests, 47 ignored), thenbuild-guest-binariesandtest-guest-binaries(33); andcheck_test_layout.py. So did the public sandbox set (8) andmanaged-lifecycle, on MSHV.The tables below ran on
5bffcd7f, the head before the rebase, with Rust 1.95.0 andNVX_BUNDLE=skip. The checks ran locally on Windows, and in temporary worktrees on nvx-mshv-test (Azure Linux 3, kernel 6.18, linux-mshv, virtual machine) and nvx-kvm-test (Azure Linux 3, kernel 6.6, linux-kvm, virtual machine). The gates are those thatlocal_gates.py --filesselects for the change, run from this branch's actions. The runtime adapter's gates, which it also selects, no longer exist since #1499. The Windows gates and the default suites ran on58295ea6, whose tree differs from this head only by the review's doc fixes and the kept cases oftests/supervisor.rs; the checks that those reach ran again on5bffcd7f, as the tables say, and the Linux gates ran on it:cargo fmt --all --check-D warnings:--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 testing5bffcd7f,--all-targets --all-featuresand--all-targets-D warningsfor--target x86_64-unknown-linux-gnu:--all-targets --all-features,--lib,--all-targets,--lib --bins --features cli,--lib --no-default-features --features guest5bffcd7f,--all-targets --all-featuresand--all-targetscargo check --locked --all-targets --all-features --target aarch64-apple-darwincargo test --locked --all-features5bffcd7f,tests/supervisor.rs: 11, and its 2 fixtures ignoredcargo test --locked5bffcd7f,tests/supervisor.rs: 11cargo build --locked --lib --no-default-features,cargo test --locked --lib --no-default-featurescargo test --locked --lib --features bundled artifactswith a synthetic releaseRUSTDOCFLAGS=-D warnings cargo doc --locked --no-deps --all-features, and the crate's doc test,nvx-rs/src/lib.rs - (line 61)python scripts/public_api.py(both snapshots)--update, then passedcargo +1.89 check --locked --all-targets --all-features(MSRV)python3 scripts/nvx.py check-guest-binaries --toolchain 1.95.0build-guest-binaries, thentest-guest-binariespython scripts/check_test_layout.pypython scripts/check_markdown_links.pycheck_matrix.py)host/store/mod.rstwice, and the template rows of #1507 and #1513), as the check exempts only SL5.2's deletionsOn nvx-kvm-test,
tests/supervisor.rspassed with--all-featuresand with the default features: 7, and its 2 fixtures ignored. Its Windows cases passed locally. The Linux runs started every test with the default signal dispositions, as CI does. A first run inherited an ignored SIGINT from a background launcher and failed the CLI's interrupt tests. Those tests passed once their dispositions were the default.The microVM scenarios ran with the static musl
nvx-rsthat CI runs, CI run 43149037772's guest artifacts (5b3fab2c, the same guest inputs) and that run's OpenVMM build of the pin (14dc4116), with its provenance:--shard 1/2and--shard 2/2(on58295ea6, whose runtime code is this head's)managed-exec-config,sandbox-lifecycle,sandbox-proxy-only,sandbox-ram-upper,sandbox-gpt-layer,vm-lifecycle,snapshot-coreandsnapshot-tiersThe shards include
managed-lifecycleand the same-host restores, which spawn VMs throughvm::spawnand its private lock. On WHP, the run used that CI run's Windows OpenVMM,7abd8c8d, of the same pin, on Windows 11.Left to CI: the default suites on WHP, the debug-kernel, Ubuntu and Azure Linux suites, and the benchmarks.
A code-review agent reviewed the whole diff. This head folds in its valid findings:
src/host/store/mod.rs, anddoc/run.mdanddoc/project-structure.mdstill described the sandbox store, the instance and the supervision;tests/supervisor.rswhole would have lost the only tests of a spawn withbreakaway_from_joband of the working-directory limit, which led to keeping its cases of what stays.It found no change in the behavior of
host::vm,host::sandboxorhost::snapshotwith or withoutcli, and nothing in the public API, the test layout or the transitional module's docs.Changes to existing tests (
tests-modified)Besides the removals above, each change drops or replaces what used a deleted item, or follows the
cligate of what it calls:activation::tests::the_limits_keep_their_valuesandopaque_values_keep_their_bytes_and_display_them_in_hexadecimaldrop their checks ofIdentity, which leaves. Their checks of the other types stay.host::platform::linux::tests::a_full_control_backlog_never_replaces_the_callers_probe_deadlineandhost::platform::windows::endpoint::tests::a_busy_control_pipe_never_replaces_the_callers_probe_deadlinecompile only withcli, asendpoint_server_pid_untilnow does. They call it withInstant::now() + 5 s, where they called the deletedendpoint_server_pid, which passed it that deadline.host::platform::tests::the_stores_tell_files_apart_by_the_identities_that_their_seals_holdcompiles only withcli, as the file identities that it checks now do.host::platform::windows::testscompile only withcli, as the log claims that they check now do:a_process_spawned_under_the_spawn_lock_does_not_inherit_a_vmms_log,a_process_spawned_without_the_spawn_lock_in_a_window_holds_the_vmms_log,a_process_spawned_in_the_window_of_a_vmm_in_its_logs_job_holds_the_log_but_not_its_claim,a_job_that_is_not_the_users_under_the_name_of_a_logs_job_is_not_the_logs,an_object_of_another_type_under_the_name_of_a_logs_job_is_not_the_logs,what_a_link_under_the_name_of_a_logs_job_leads_to_is_not_the_logsanda_vmm_never_starts_outside_a_job_that_a_claim_check_takes_for_its_logs. So do their helpersHeldSpawnand its functions,claim_released_withinandheld_open.host::platform::windows::tests::a_vmm_whose_log_is_no_file_of_a_disk_volume_starts_without_a_jobkeeps its one claim check only withcli. So dohost::platform::windows::private::tests::private_directories_support_long_pathsandhost::vm_directory::tests::existing_vm_directories_that_grant_others_or_inherit_are_refused_and_left_unchangedwith their checks ofcheck_store_dir. Everything else in them runs as before.host::vm::tests::an_unrelated_process_started_in_the_library_spawn_window_gets_no_vm_claim(Windows) compiles only withcli, aslog_claim_held, which it checks, now does.host::platform::windows::endpoint::tests::a_duplicated_transport_keeps_the_verified_connection_without_reconnectingandhost::platform::windows::tests::a_restore_ready_client_that_closed_before_its_connection_was_accepted_is_read_to_its_endname their pipes with a random suffix of their own,host::tests::unique_suffix(). Before, they took one fromLaunchId::generateorcontrol_endpoint, which leave. So do the helpersStaleServer::newandhost::transport::tests::endpoint.host_modules::the_graph_holds_well_known_dependencies_of_the_sourceschecks the edgesvm -> spawn,supervisor -> spawnandspawn -> platformin place ofinstance -> store,supervisor -> storeandstore -> spawn, and keepscli -> sandbox.supervisor::processes_can_be_shared_between_threadsno longer checksVmm, which leaves.supervisor::a_process_that_this_user_may_not_query_has_an_unknown_statekeeps its check thatProcess::openfails withPermissionDeniedand leaves the process running, and drops its second half, which reattached a sandbox store to that process.host::tests::released, with its constants, compiles on Windows or withcli, where its callers do. The snapshot fixtureSnapshotFixture::newand the CLI's Windows lifecycle helperunprovisionedcreate their private directories withvm::create_private_dir, where they used the sandbox store's.activation::tests,host::cli::store::tests,host::platform::{tests, linux::tests, windows::tests},host::tests, the CLI's Windows lifecycle tests andtests/supervisor.rsfollow these changes.