Repository navigation
guest: repair restored snapshots before capture returns - #1395
Pedro Henrique Penna (ppenna) merged 5 commits into
Conversation
This pull request changes existing testsIt modifies or removes 8 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: 70; added: 5. Compared the merge base |
There was a problem hiding this comment.
🟡 Changes recommended
The snapshot documentation and README recommend attach() after RESET, which returns InvalidState; they should instead document acknowledge(window) before receiving the activation record.
1 open issue
What changed in this PR
Extends the fresh-capture API from #1394 so restored guests complete the existing repair before capture returns.
Changes:
- Returns
Captured::Restored(Repaired)after repair and preserves repair errors as fatal dispositions. - Moves repair into
guest::snapshotwhile retaining legacy activation exports. - Updates capture-path tests, public API records, and transport documentation.
| File | Description |
|---|---|
| nvx-rs/src/guest/snapshot/tests.rs | Adds a restored-capture fixture and checks fatal unseeded restores. |
| nvx-rs/src/guest/snapshot/repair/tests.rs | Exercises repair ordering, results, and errors through capture. |
| nvx-rs/src/guest/snapshot/repair.rs | Relocates repair and shares its system interface with capture. |
| nvx-rs/src/guest/snapshot.rs | Runs restore repair inline and returns repaired data or fatal errors. |
| nvx-rs/src/guest/activation.rs | Preserves legacy exports and adds repair failure variants. |
| nvx-rs/README.md | Documents inline repair and post-restore transport handling. |
| nvx-rs/public-api/linux.txt | Records the new snapshot results and repair exports. |
Review effort: Balanced
There was a problem hiding this comment.
🔵 Needs a closer look
The live restored-capture path coordinates resource activation, reseeding, and host acknowledgement, but fake-based tests and the adapter’s legacy capture path leave hardware-backed integration evidence needing maintainer review.
No open issues 🎉
1 resolved since last review
Review effort: Balanced
a84f797 to
9659385
Compare
Run the existing repair inline for Restored and retain its resource, acknowledgement, progress and fatal status data. Move its implementation and tests to snapshot, preserving the legacy activation compatibility exports and the existing repair order and retries. Document reset and reattach before activation. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: ae78ba03-49fb-48e4-bc75-8fac5afcabcf
Regenerate the Linux snapshot from the current source, including the inherited Fresh capture surface and the inline repair result and failure detail. The Windows snapshot is unchanged. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: ae78ba03-49fb-48e4-bc75-8fac5afcabcf
Avoid shadowing the inline capture test helper, document the repaired result and restored transport rule, and retain the existing report-only finish process exception and legacy capture-stage order. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: ae78ba03-49fb-48e4-bc75-8fac5afcabcf
Carry only the three test-fixture lines from 49d74dd after the owned runtime commands ended. The socket tables are immutable and stubbed servers finish before release, so two failed observations preserve the 13 cases without redundant Windows shell subprocesses. Production guest polling, assertions and the ten-second subprocess deadline remain unchanged. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: ae78ba03-49fb-48e4-bc75-8fac5afcabcf
Correct the snapshot and README transport instructions to acknowledge the RESET on the existing GuestConnection before receiving activation. attach() is valid only for a detached session; no protocol or repair behavior changes. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: ae78ba03-49fb-48e4-bc75-8fac5afcabcf
ddd62a6 to
0dd708c
Compare
There was a problem hiding this comment.
🔵 Needs a closer look
Exact-head guest/runtime validation remains pending, and seam tests do not establish the real restore and RESET/ACK lifecycle while the runtime adapter still uses legacy capture and repair.
No open issues 🎉
Review effort: Balanced
0dd708c
into
feature/nvx-refactor

Part of #1105.
Summary
Based on #1414 at
8b2a392a. This layer makes restored capture return only afterthe existing repair completes.
Captured::Restored(Repaired)after inline repair, retaining operationorder, retries, CPU/memory handling, reseed and acknowledgement.
guest::snapshot; legacyactivation/clone exports use the same implementation. Repair failures retain
their detail/status and map to
MustEnd.GuestConnection::acknowledge(window)on the existing session before receivingactivation. Fresh capture deadlines, port release and rollback are unchanged.
The complete delta is 52 core lines in 3 counted files, 7 logical/9 raw paths,
plus 78 documentation and 103 test lines. All five original commits are replayed
once, in order, without patch, message or trailer changes; the already-empty
fixture commit is retained. The original and rewritten commits are unsigned.
No correction delta was needed. The OpenVMM pin remains
14dc4116; no kernel,VMM, dependency, protocol or repair-state-machine change is included.
Validation
Current candidate:
0dd708cfa28ede292101feba561b1e3a3de9dcf7, based on8b2a392ae6fd5f73f1b27fb2a0e109ce36d068e3.current base, zero merges, identical ordered patches/messages/trailers, clean
source/native checkout, whitespace, test layout and complete size measurement.
attempt 1, concluded successfully for this exact head. Nine conditional jobs
were skipped; those skips are not test passes.
source/native hashes and four nonblocking observations retained. Current-head
Copilot review reports no open issues. Its earlier caution about missing real
inline capture/RESET/ACK evidence is addressed by the later, separate local
witness below, not by relabeling the legacy adapter.
adapter, CLI and quality checks. CLI: 1,823 tests/67 skips; adversarial:
84 tests/11 skips; host-profile tests: 4 passed. The remaining Specula test
command fails on Windows because
fcntlis unavailable; the identical commandalso fails on the exact parent with byte-identical Specula code. It is not
relabeled a pass or fixed outside this layer.
CLI: 1,823 tests/30 skips; adversarial: 84 tests/no skips; Specula: 25 passed.
This does not relabel the unsupported Windows Specula command.
156-scenario/11-target adapter command, the complete default Alpine command,
and the required Ubuntu six-scenario and Azure Linux seven-scenario commands.
These are successful whole commands, not combined prefixes or selector subsets.
Outer Rust test concurrency was bounded to one; scenario assertions, internal
clone concurrency, deadlines and timeouts are unchanged.
copy of the current adapter linked to this exact NVX source. Its actual compiled
guest calls
snapshot::capture(Fresh, deadline), returnsRestored(Repaired),consumes RESET and calls the existing acknowledgement before activation.
The two original CPU/memory resource scenarios and their assertions are
unchanged. Each backend passed both cases with five actual existing guest
activation-probe responses showing acknowledged repair, then ordered RESET,
first message, Ready and start. All 66 fixture sources, genuine compiled
binaries, guest call edges, source/native indices and before/after hashes are
retained. This fixture is not a production producer or protocol change.
path length, then an interrupted whole command after the resource sampler raced
normal removal of a temporary file. The corrected sampler credits no volatile
allocation and retains the complete growth budget and safety floors. An exact
restrictive-umask negative control failed; the unchanged case passed with the
ordinary child umask. Only private execution layout/wrappers changed.
The first WHP witness's console-marker audit also remains failed: that adapter
deliberately disables the console. The separate successful proof captures
actual existing probe replies, not fabricated console markers.
no native or kernel rebuild or pin change was needed. Runtime commands use
frozen genuine prebuilt runners, without a compiler during an owned VM phase.
Unavailable, failed or skipped checks are not passes.
currently has an unrelated KVM test failure; the ancestor chain is not claimed
qualified.
Historical evidence, not current-head passes
ddd62a60, documentation checks and warning-denied documentation buildspassed on both platforms, with independent review of the RESET/ACK wording.
974f2d6b, complete CLI checks ran 1,822 tests on each platform, with67 Windows skips and 32 Linux skips, plus adversarial/host/help checks.
Rust/API/MSRV/guest/runtime evidence used explicitly bound earlier component
inputs, not artifacts relabeled as the later documentation-only head.
complete 156-test/11-target adapter suites. WHP default coverage combined a
same-input passing prefix and remaining selectors (51 selectors/57 processor
spans), not one successful whole command. Failed/interrupted commands remain
failures. A Linux all-features correction used a complete serial run; a Linux
adapter path-depth correction used a private mount-only temporary directory and
unprivileged VMM driver. No expectations, skips or timeouts were weakened.
nonblocking observations retained in the historical evidence. None is a fresh
review or CI pass for this candidate.
Existing test changes (
tests-modified)expandsandfailurenow drive repair through capture; resource assertionsremain, and failures also check the repair stage, retained detail and fatal
disposition/status.
an_ungated_restore_is_finished_without_an_acknowledgementandthe_instant_of_the_acknowledgement_precedes_the_deferred_work_of_the_finishuse that seam without weakening acknowledgement/order assertions.
each_failure_class_ends_the_clone_with_a_status_of_its_ownalso checkscapture's fatal mapping for every existing repair status.
a_repair_draws_no_randomness_before_its_reseedchanges only its relocatedsubprocess selector.
NoSeeddetail withREPAIR_RESTOREfatal status.relocations, 8 existing-item changes and 5 added test items.