Skip to content

nvx-rs slimming, phase 4.2: the old code is deleted, consumers first #1087

Closed
4 of 4 issues completed
Closed

Description

Parent: #1076. Phase: 4, the slim library. Needs: #1077, #1081, #1082, #1083, #1085; inside phase 4, groups of #1086 (see the table below). Unblocks: inside phase 4, groups of #1088; #1090.

Goal. The old code leaves after its last user in NVX: the old clone path, the template store, the sandbox store and its supervisor, the old configs and launch paths, bundled, the exec engine, the guest's process modules and cgroups, the old capture steps, the announcer's spawner, and the old layered init. The code that stays first stops using what leaves, and nvx-ingress start spawns its announcer itself. Each deletion also removes the crate-private code that it leaves unused, as the compiler finds it.

Today (dev e42b1795) and after:

Area Today After
Retained dependencies Strict snapshot reads, the artifact modules, the snapshot key and PreparedLaunch reach helpers through store or supervisor paths. Strict reads use the host's private OS layer (host::sys); the artifact modules and the snapshot key use host::runtime; and PreparedLaunch takes Inherited from its low-level owner.
Announcer guest::ingress::{Announcer, PROGRAM, StartError}: nvx-ingress start uses them, and they spawn through the guest's process modules. Gone, before the process modules: nvx-ingress start spawns its announcer itself.
Stores and the clone path host::store, host::instance, the template store, leases, capture transactions, clone and failure records, store-based reattach, CloneControl, ClonePlan, CloneRequest, quarantine, and the store-coupled supervisor. Gone, with the supervisor's public spawn-lock helpers and the last store identity types. The CLI keeps its own store.
Configs and launch LaunchSpec and the rest of host::launch, SandboxPlan, SandboxLaunch, SandboxSettings, SandboxNetwork and CaptureClass; the old aggregate naming and boot rendering, and NVX's guest tokens; the one-shot launch, the checked-file transfer and the generic spawn_command. Gone; the shell /init stops reading OpenVMM's lifecycle tokens, which only the old launches sent, and stops handing their layered roots to the old layered init. The private OS layer keeps the internal spawn lock, the termination after a failed spawn, and only the launch code that host::vm::spawn uses.
bundled A build script that stages a release, links = "nvx", artifacts.json and the NVX_BUNDLE* variables. Gone. NVX_OPENVMM, NVX_AUTO_DOWNLOAD and NVX_RS keep their meaning.
Exec nvx::exec, guest::exec::binding, guest::{exec, spawn, process, cgroup, entry} and guest::root::{bootstrap, Bootstrap, BootstrapStep, Resources}, with their per-exec OS code. Gone. Root::switch keeps the move and the change of root; the private guest OS layer keeps only code that something uses.
Old capture steps CapturePreparation, CaptureBarrier, AdmissionFence, Restored::into_parts, CaptureError::into_cause and the public repair; TimeAbi's capture and restore calls and their types are public. The old steps and methods are gone. The repair, TimeAbi::{capture, restore_finish} and the types that only they use are private to guest::snapshot.
Old layered init guest/common/nvx-init-agent, the Azure Linux one-shot container helpers, and the managed agent's sandbox mode. Gone. guest/common/nvx-snapshot stays, for blockless snapshots, tests and benchmarks.

Groups, in order. Each group issue lists its PRs, with their goals, contents, Needs and estimates.

Group issue Delivers PRs Needs
#1120 The code that stays stops using what leaves SL6.0a, SL6.0b, SL6.0c, SL6.11c, SL6.13c #1091, #1102, #1105, #1119
#1121 The old clone path, template store and sandbox store are gone (leaving code) SL6.2b, SL6.2a, SL6.1 #1112, #1119, #1120
#1122 The old configs, the old launch code and bundled are gone (leaving code) SL6.3, SL6.6a #1121
#1123 The exec engine, the process modules and the old layered init are gone (leaving code) SL6.11a, SL7.8b, SL6.11b #1105, #1111, #1112, #1116, #1117, #1119, #1120, #1122

Notes.

  • Three of its four groups are leaving code. Their issues open with the note, and have no size limit. The first group changes code that stays, so it follows the limits.
  • Consumers go before providers. The clone path goes before the template store, then the sandbox store.
  • The compiler audits private code. Each deletion removes the crate-private code it leaves unused. No separate pruning PR or final public-item audit remains.

Tests. The strict snapshot reads keep their regular-file check through host::sys. Captures and restores use the one-call path after the old capture steps go. The fake VMM's own integration cases leave the instance's test file, and the retained spawn-lock tests stop calling spawn_command, before the deletions. After SL6.3, the shell /init no longer recognizes the old lifecycle and workload tokens. Each PR keeps, rewrites or retires the tests of its area by name, consistently with the case matrix of #1086. Every PR passes the crate's checks and cargo clippy --lib --no-default-features -- -D warnings.

Done when: every group issue is closed; the retained code uses the new owners stated above; every deleted area and the private code it leaves unused are gone; the repair, TimeAbi::{capture, restore_finish} and the types that only they use are private to guest::snapshot; and the crate's checks and the clippy command pass.

Activity

  1. ppenna commented on Nov 12, 2026

    @ppenna
    Contributor

    Completed on feature/nvx-refactor. All four group issues are closed:

    The push CI run at d67a2d5ab57, which contains all of them, passed: https://github.com/microsoft/nvx/actions/runs/43309050295

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions