Repository navigation
host: move snapshot metadata to its own names - #1345
Merged
Pedro Henrique Penna (ppenna) merged 3 commits intoNov 8, 2026
Merged
Pedro Henrique Penna (ppenna) merged 3 commits into
Pedro Henrique Penna (ppenna) merged 3 commits into
Conversation
Contributor
This pull request changes existing testsIt modifies or removes 44 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
Test data
Relocated unchanged: 120; added: 5. Compared the merge base |
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues block the snapshot metadata rename.
No open issues 🎉
What changed in this PR
Moves NVX’s snapshot metadata from host::template to host::snapshot, implementing the metadata-renaming slice of #1102 while retaining legacy template aliases. Snapshot opening and VM lifecycle changes remain out of scope.
Changes:
- Relocates keys, manifests, codecs, and restore-time eligibility without changing manifest validation or geometry checks.
- Renames the public types to
SnapshotKeyandSnapshotManifest; removes the key’sguest_buildfield and changes its hash domain in place at version 1. - Updates tests, conformance vectors, documentation, and both platform API snapshots.
| File | Description |
|---|---|
tests/runtime-adapter/tests/vm_template.rs |
Removes the obsolete key guest-build assertion. |
tests/runtime-adapter/README.md |
Distinguishes capture-class guest build from key identity. |
nvx-rs/tests/vectors/snapshot-key-v1.txt |
Supplies vectors for the revised key encoding and hash domain. |
nvx-rs/tests/vectors/README.md |
Documents renamed vectors and the in-place format change. |
nvx-rs/tests/fixtures/template/README.md |
Updates the documented manifest reader name. |
nvx-rs/src/host/template/store/tests.rs |
Uses relocated metadata fixtures. |
nvx-rs/src/host/template/store/leases/tests.rs |
Imports fixtures from snapshot tests. |
nvx-rs/src/host/template/store/capture/tests.rs |
Imports relocated capture fixtures. |
nvx-rs/src/host/template/mod.rs |
Retains metadata aliases and generation eligibility. |
nvx-rs/src/host/template/clone/tests/launch.rs |
Updates the shared artifact-helper import. |
nvx-rs/src/host/template/clone/tests.rs |
Updates fixture imports and key diagnostic expectations. |
nvx-rs/src/host/snapshot/wire/tests.rs |
Relocates protobuf reader coverage unchanged. |
nvx-rs/src/host/snapshot/wire.rs |
Relocates the strict protobuf reader. |
nvx-rs/src/host/snapshot/tests.rs |
Relocates shared fixtures with host-scoped visibility. |
nvx-rs/src/host/snapshot/manifest/tests.rs |
Updates manifest tests to the snapshot type name. |
nvx-rs/src/host/snapshot/manifest.rs |
Renames and relocates the manifest reader. |
nvx-rs/src/host/snapshot/key/tests.rs |
Updates key coverage and adds guest-build removal regressions. |
nvx-rs/src/host/snapshot/key.rs |
Renames the key and revises its encoding and hash domain. |
nvx-rs/src/host/snapshot/eligibility/tests.rs |
Relocates restore-window coverage unchanged. |
nvx-rs/src/host/snapshot/eligibility.rs |
Relocates eligibility logic without the template-generation dependency. |
nvx-rs/src/host/snapshot/canonical/tests.rs |
Relocates canonical codec coverage unchanged. |
nvx-rs/src/host/snapshot/canonical.rs |
Relocates canonical encoding utilities. |
nvx-rs/src/host/snapshot.rs |
Defines and documents the public metadata module. |
nvx-rs/src/host/mod.rs |
Exposes snapshot metadata and documents module responsibilities. |
nvx-rs/README.md |
Documents snapshot APIs and legacy template aliases. |
nvx-rs/public-api/windows.txt |
Records the Windows API additions and removed getter. |
nvx-rs/public-api/linux.txt |
Records the Linux API additions and removed getter. |
Review effort: Balanced
Enrique Saurez (esaurez)
force-pushed
the
esaurez/slim-2.3.2-sl2.12a-publication-20261107
branch
from
November 7, 2026 22:58
abb3835 to
89db081
Compare
Enrique Saurez (esaurez)
changed the base branch from
feature/nvx-refactor
to
esaurez/slim-3.2.1-sl4.2-canonical-20261107
November 7, 2026 22:59
Base automatically changed from
esaurez/slim-3.2.1-sl4.2-canonical-20261107
to
feature/nvx-refactor
November 7, 2026 23:53
Enrique Saurez (esaurez)
marked this pull request as ready for review
November 8, 2026 01:24
Own the key, manifest, codecs and time eligibility in host::snapshot while retaining the template re-exports for current users. Remove guest_build from the key and change its version 1 encoding and hash domain in place. Keep the existing opaque snapshot shell and capture and restore behavior. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 7f9c3ba3-e38b-427c-8ed6-da7a970c21a9 Copilot-Session: 0325d032-38a9-4c7f-9899-687a4ec93a51
Keep HostClock parsing visible to the existing template store within the host boundary. Moving the manifest must not hide the parser from its current caller. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 7f9c3ba3-e38b-427c-8ed6-da7a970c21a9 Copilot-Session: 0325d032-38a9-4c7f-9899-687a4ec93a51
Keep the existing key-identity error shared by the template lease parser, and update the clone test for the renamed key. Retain Generation eligibility at the template boundary so snapshot metadata does not depend on its legacy store. Update the directly affected metadata documentation. The snapshot module exports metadata only, independent of cold VM preparation and spawning. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 7f9c3ba3-e38b-427c-8ed6-da7a970c21a9 Copilot-Session: 0325d032-38a9-4c7f-9899-687a4ec93a51
Enrique Saurez (esaurez)
force-pushed
the
esaurez/slim-2.3.2-sl2.12a-publication-20261107
branch
from
November 8, 2026 02:56
89db081 to
1106886
Compare
Pedro Henrique Penna (ppenna)
merged commit Nov 8, 2026
489ce50
into
feature/nvx-refactor
60 of 61 checks passed
Pedro Henrique Penna (ppenna)
deleted the
esaurez/slim-2.3.2-sl2.12a-publication-20261107
branch
November 8, 2026 04:03
This was referenced Nov 8, 2026
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.
Refs #1102
Move the existing key, manifest, canonical codecs, and time eligibility from
host::templatetohost::snapshot. The public types areSnapshotKeyandSnapshotManifest; the template names remain aliases of the same types.The key drops its separate
guest_buildfield and uses thenvx snapshot key\0hash domain. Its runtime identity is unchanged.Version 1 changes in place, without a prior-format decoder or migration:
snapshots do not survive a deployment.
CaptureClassstill holds the guestbuild and retains its encoding and identity domain. Manifest validation,
geometry checks, and time eligibility are unchanged.
This metadata slice is based on landed #1331 at
3ad5e49donfeature/nvx-refactor, retaining the capture configuration merged in #1275.Only the three metadata commits remain; the inherited parent commits are
already landed. It adds the metadata module, not VM
preparation, spawning, the opaque VM snapshot input,
Snapshot::open, orSnapshot::accepts.Public API and size
Both generated API snapshots add the same 113 metadata items under
host::snapshot. The key, manifest, clock, time, eligibility, downtime, andmanifest limits stay public, and the legacy template aliases stay available.
The only removed legacy API item is
TemplateKey::guest_build.The complete three-commit change measures 36 core lines in 5 counted files,
28 changed paths, including all moves, tests, fixtures, documentation, and
generated API snapshots. No manual exclusions are applied.
The three commits retain the metadata move and its corrections. Validation
covers the final combined head, not the intermediate commits.
Tests
The complete comparison against
3f217d54reports 44 changes to existingtest assets, 120 unchanged relocations, and 5 added items. Existing coverage
is retained apart from the deliberately removed key guest-build field:
template/{canonical,wire,eligibility}/tests.rssnapshot/, with the same test configuration and assertions.template/key/tests.rs:manifest,key,network_key,assert_mismatched,key_refusal,VECTORSeach_part_of_the_key_changes_it,each_contract_version_changes_the_key,a_key_holds_what_its_capture_madeSnapshotKeyand the deliberate absence of key guest-build data; all remaining key fields and contract checks are kept.a_capture_that_does_not_match_its_class_is_refused,invalid_classes_are_refusedkeys_read_back_from_their_canonical_encoding,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,the_conformance_vectors_decode_and_encodetemplate/manifest/tests.rs:parse,refusal,read_refusal;the_fields_of_a_manifest_need_not_be_written_in_their_order,truncated_manifests_are_refused,the_manifests_that_openvmm_writes_are_read,read_reads_the_manifest_of_a_snapshot,read_refuses_a_fifo_without_waiting_for_a_writerSnapshotManifestand the snapshot fixture paths. Parsing, truncation, actual OpenVMM fixture, bounded file-read, and FIFO assertions are unchanged.DeviceSpec,AttachmentSpec,NetworkSpec,BlockSpec,TimeSpec,CpuSpec,ManifestSpec,ContractSpecintemplate/tests.rssnapshot/tests.rs; host-private visibility keeps the remaining template tests using the same fixtures.template/clone/tests.rs,template/clone/tests/launch.rs,template/store/capture/tests.rs,template/store/leases/tests.rs,template/store/tests.rspublish_for_testsandpublish_spec_for_testskeys_of_another_encoding_version_are_failures_of_the_host_that_quarantine_nothingruntime-adapter/tests/vm_template.rs::assert_capturedtemplate/key/tests.rsandtemplate/manifest/tests.rstests/vectors/template-key-v1.txtsnapshot-key-v1.txtfrom the specified encoding: remove the guest-build key field and recompute key hashes with the new domain. Existing malformed/version cases remain; capture-class vectors are unchanged.Two focused regressions additionally prove that different capture-class guest
builds change the class identity but not the snapshot key, including through
the legacy alias, and that keys carrying the removed field are refused by
both names. The existing key-identity/lease-parser parity assertion is kept
unchanged. The production module-layering test is also unchanged.
Validation
Checks below ran at
89db081f205ce4974cb1604b8a968fc12a82829dand arereused for history-only restack
1106886aa8e397113aac4f5cc4f148656f766c53.Every original metadata commit retains its source tree. The final source tree
00af53fda3873714ca07fb6d16e8914e3bc727dband effective parent tree8c7a51d779b777a9993c20dcac8c295def316775are unchanged, as is the pinnednative input. No check is claimed rerun at the new commit ID.
ignored; Linux: 254 passed, 5 existing role entries ignored.
the fake-VMM capture/creation/recovery suite passed 6 cases with 1 existing
subprocess role ignored.
Markdown links, and the complete test-change inventory passed.
The macOS all-target/all-feature cross-check passed with existing warnings
in unsupported-host test paths.
and Rust 1.89 checks passed on both OSes. The independent adapter passed
49 protocol tests on each OS, 128 host tests on Windows, and 127 on Linux;
its lint, docs, and MSRV configurations also passed on both.
No hardware-backed VM matrix was run for this metadata-only slice. The
adapter's 92 existing native-VM cases remain ignored, not passing. This Draft
does not claim CI, native runtime, or merge readiness.