Skip to content

Refactor Cloud Hypervisor startup into network, staging, and launch stages - #11905

Merged
lpcox merged 3 commits into
mainfrom
copilot/refactor-split-startcloudhypervisor
Nov 21, 2026
Merged

lpcox merged 3 commits into
mainfrom
copilot/refactor-split-startcloudhypervisor

Conversation

@lpcox

@lpcox lpcox commented Nov 21, 2026 •

Copy link
Copy Markdown
Collaborator

startCloudHypervisor mixed network allocation, artifact staging, and VMM launch in one deeply nested function, obscuring partial-start resource ownership.

  • Stage boundaries
    • Network: topology resolution, reservation, setup, and release on cleanup-record failure.
    • Staging: rootfs preparation, run directory, cgroup, artifacts, diagnostic files, and ownership validation.
    • Launch: device access, process registration, API readiness, confinement verification, virtiofsd, and VM creation.
  • Preserved contracts
    • Unchanged public signature, startup ordering, and shared check wrapper.
    • Orchestrator retains startup-error reporting, evidence preservation, and partial-start cleanup.
  • Regression coverage
    • Stage ordering, early failure attribution, reservation-release errors, and device-access revocation before cleanup.

@lpcox lpcox changed the title [WIP] Refactor startCloudHypervisor into network, staging, and launch stages Refactor Cloud Hypervisor startup into network, staging, and launch stages Nov 21, 2026
@lpcox
lpcox marked this pull request as ready for review November 21, 2026 16:38
Copilot AI adaptive review requested due to automatic review settings November 21, 2026 16:38

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

The asynchronous VMM stage extraction spans privileged network ownership, temporary device ACLs, and partial-start cleanup, requiring human review of cross-stage failure and teardown ordering.

No open issues 🎉

What changed in this PR

Refactors AWF’s Cloud Hypervisor startup into explicit network, staging, and launch stages, making resource ownership and partial-start cleanup easier to follow.

Changes:

  • Extracts network setup, artifact staging, and confined VMM launch into dedicated modules.
  • Keeps the public startup signature, shared check wrapper, error reporting, and cleanup in the orchestrator.
  • Adds regression coverage for startup ordering, early failures, reservation release, and device-access revocation.
File Description
src/​cloud-hypervisor/​manager-start.ts Coordinates the extracted stages and retains startup-error handling.
src/​cloud-hypervisor/​manager-start-stage.ts Prepares rootfs, run directory, cgroup, artifacts, and ownership checks.
src/​cloud-hypervisor/​manager-start-network.ts Handles topology resolution, network reservation, setup, and release errors.
src/​cloud-hypervisor/​manager-start-launch.ts Handles device access, VMM launch, confinement, virtiofsd, and VM creation.
src/​cloud-hypervisor/​manager-launch.test.ts Checks stage ordering and device-access revocation before cleanup.
src/​cloud-hypervisor/​manager-launch-evidence.test.ts Extends original-failure attribution coverage to earlier startup stages.
src/​cloud-hypervisor/​manager-cleanup.test.ts Covers reservation release when cleanup-record capture fails.

Review effort: Max (adaptive)

@github-actions

Copy link
Copy Markdown
Contributor

✅ Copilot review passed with no inline comments.

@lpcox Add the ready-for-aw label to this PR to trigger agentic CI smoke tests.

@lpcox

lpcox commented Nov 21, 2026

Copy link
Copy Markdown
Collaborator Author

@copilot merge main, resolve conflicts, and address review feedback

…t-startcloudhypervisor

Co-authored-by: copilot-swe-agent[bot] <[email protected]>

Copilot AI commented Nov 21, 2026

Copy link
Copy Markdown
Contributor

@copilot merge main, resolve conflicts, and address review feedback

Merged main in ab12bc3 without conflicts; there are no open review findings. Local build/lint/tests were blocked by unavailable npm dependencies. Earlier CI reported a non-conventional PR title and image-scan findings; merged CI results are pending.

@lpcox
lpcox merged commit 677da2b into main Nov 21, 2026
46 of 48 checks passed
@lpcox
lpcox deleted the copilot/refactor-split-startcloudhypervisor branch November 21, 2026 18:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Refactoring] Split startCloudHypervisor in manager-start.ts into network, staging, and launch stages

3 participants