Repository navigation
host: give a VM's machine, root, view and console one checked value - #1269
Pedro Henrique Penna (ppenna) merged 2 commits into
Conversation
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues were identified for the VM configuration changes.
No open issues 🎉
What changed in this PR
This PR adds host::config::VmConfig, grouping a VM’s machine, root, workload view, exports, and boot console into one value. It advances #1097 by complementing the shared launch configuration introduced in #1268.
Changes:
- Adds configuration types and validation that performs no host I/O.
- Introduces
activation::Viewand shares hostname validation with activation records. - Adds validation tests, documentation, and matching Linux and Windows public API entries.
| File | Description |
|---|---|
nvx-rs/src/host/mod.rs |
Exposes and documents the configuration module. |
nvx-rs/src/host/config/tests.rs |
Tests valid configurations, refusals, RAM limits, and reserved export targets. |
nvx-rs/src/host/config/mod.rs |
Defines VM configuration types and host-independent validation. |
nvx-rs/src/activation/mod.rs |
Adds View and extracts shared hostname validation. |
nvx-rs/README.md |
Documents the configuration module and workload view. |
nvx-rs/public-api/windows.txt |
Records the new public API for Windows. |
nvx-rs/public-api/linux.txt |
Records the same public API additions for Linux. |
Review effort: Balanced
|
Scope update following the revised #1076/#1097 contract: remove the dependency on the retired error-type PR #1267.
Adapt this PR on the updated runtime PR #1268, without the obsolete ancestor. Earlier validation remains evidence for its recorded head, not a pass for the revised branch. Current-design readiness is held until the affected checks and reviews are qualified; no Ready transition or manual CI dispatch is included. |
3e16d00 to
5ea566f
Compare
348d276 to
a625878
Compare
5ea566f to
98bb4a4
Compare
a625878 to
885be7b
Compare
This pull request changes existing testsIt modifies or removes 1 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: 12. Compared the merge base |
885be7b to
49d74dd
Compare
|
Existing test update in
The production |
Add VmConfig in the new host::config: a VM's processors, its memory in MiB, its root, blockless or layered, the View that its workload has of it, the export plan of the host paths that it exports, and where its boot console's output goes, to a listener or nowhere; the console's device exists either way. A layered root names its image and format, an optional bound of a GPT disk's first partition, its overlay mode, and a scratch upper with its journal policy or a RAM upper whose cap is 1 to 90 percent of the VM's memory, 50 by default. VmConfig::check checks the whole value without reading the host, and returns the first refusal as an Error of kind Unsupported, whose message names what it refuses; an export's refusal keeps the error of ExportPlan::check as its source. It reuses activation's journal, overlay and machine-ID vocabulary, the record's hostname rule, which becomes activation::is_hostname for both, and ExportPlan::check with the guest targets that the root reserves. Add activation::View, the hostname and machine ID that a VM's workload sees, beside WorkloadView, which the record keeps for now. The public API snapshots list the new items. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 869204bf-28f8-408e-bcab-e4353944ef69 Copilot-Session: 2d81c32c-865b-42d0-8f3e-6881809e0157
The fixture already freezes socket tables and waits for stubbed server output. Observe a failed condition twice instead of spawning 101 awk or grep processes over immutable input. Keep all 13 cases, the 10-second subprocess timeout and production polling unchanged. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 2d81c32c-865b-42d0-8f3e-6881809e0157
49d74dd to
3bd7e0d
Compare
There was a problem hiding this comment.
🟡 Changes recommended
The PR’s test-change inventory omits the modified _run_host_loopback_allow_script helper; it needs refreshing against the stacked base, documentation of the polling change, and the tests-modified label.
1 open issue
Review effort: Balanced
b7f56ab
into
feature/nvx-refactor

Part of #1097. Stacked on #1268.
What and why
SL2.3a gives a VM's machine, root, workload view, exports and boot console one
caller-owned value,
nvx::host::config::VmConfig, checked without host I/O.VmConfigholds processors, memory in MiB, a blockless or layered root,activation::View, an optionalExportPlan, and a listener or disconnectedconsole attachment. The console device exists with either attachment.
LayeredRootnames its image andRootImageformat, an optional GPTfirst-partition bound, overlay mode, and either a scratch upper with its
journal policy or a RAM upper capped at 1 through 90 percent. The default
cap is
UpperConfig::DEFAULT_MAX_MEMORY_PERCENT, 50.VmConfig::checkreturns the crate'sResult. A refusal has kindErrorKind::Unsupportedand names its field; an export refusal retainsExportPlan::check's detailed error as its source.ViewjoinsWorkloadViewwithout changing activation records. The recordand the new configuration reuse the same hostname predicate. The existing
per-execution workload identity behavior is preserved.
No paths are opened, no host support is probed, and no launch arguments are
rendered. Network and cold-boot fields remain for SL2.3b.
Public API and size
Both API snapshots add the same 32 items for
Viewandhost::config;none is removed. The README documents the new module and view.
120 core lines in 3 counted files against #1268 at
98bb4a43: 110 inhost/config/mod.rs, 9 inactivation/mod.rs, and 1 inhost/mod.rs.Tests
No existing test is retired. Existing hostname coverage
hostnames_are_admitted_up_to_the_limit_without_a_nuland export coveragereserved_targets_depend_on_the_rootare kept unchanged.The new configuration module adds four tests and their helpers:
blockless_and_layered_configurations_pass_with_either_console,a_ram_upper_holds_1_to_90_percent_of_the_memory_and_half_by_default,each_refusal_names_what_it_refuses, andan_export_passes_the_check_of_the_targets_that_its_root_reserves.The test-change inventory against the current stacked base reports 1 modified
helper and 12 added items.
MicrovmTests._run_host_loopback_allow_scriptreduces polling of immutable fixture inputs from 101 observations to two.
All 13 subcases, failure codes, assertions and the 10-second timeout remain;
the production script's 100 retries and 0.05-second sleep are unchanged.
The
tests-modifiedlabel is present.Validation
The exact head
885be7ba, directly on98bb4a43and dev256ebe3d, passes:check-nvx-rssteps, including featureisolation, MSRV, warning-denied lint/docs, real artifact-bundling staging,
OpenVMM vectors/profiles and runtime-adapter configurations.
tests, build, static-ELF checks and guest-only adapter configuration.
check-quality: Python lint/format and both platform type checks,pinned shell lint/format, Markdown links, test layout, kernel inventory,
PowerShell syntax and all 25 Specula wiring tests. CI applies this action
only to Linux; it is not counted as a Windows run.
validate-nvxunit commands: 1,810 tests each, with 67Windows and 30 Linux platform skips. The shell-dependent canceled-capture
case executes on both. Both platforms also pass all 84 standalone
adversarial tests, 4 host-profile tests, compileall and CLI help checks.
Windows uses native CPython; the Linux unit command runs with a private
process view.
guest-boot,guest-identity,managed-exec-config,sandbox-lifecycle,sandbox-proxy-onlyandsandbox-ram-upper.The complete canonical runtime-adapter suite passes all 156 scenarios
across 11 targets on each backend.
All ten guest executables and the affected Alpine and Ubuntu initramfses and
Ubuntu distro layer were rebuilt from this head's guest inputs. Both backends
used those exact outputs and independently built native host/test binaries.
Unchanged native OpenVMM, kernel and scratch inputs were verified against the
release of
256ebe3d, with OpenVMM at9cec2b89. Runtime provenance and all18 consumed-file hashes per platform were checked before and after the VM runs.
KVM execution remains with CI. Azure Linux and the complete distribution matrix
are not run at this intermediate PR; they belong to SL2.3c and CI. OpenVMM's own
suites remain with their owning CI for the unchanged pin.