Skip to content

[codex] add linux amd64 startup snapshots#46

Merged
Vbitz merged 1 commit into
mainfrom
codex/linux-amd64-startup-snapshots
Jul 2, 2026
Merged

[codex] add linux amd64 startup snapshots#46
Vbitz merged 1 commit into
mainfrom
codex/linux-amd64-startup-snapshots

Conversation

@Vbitz

@Vbitz Vbitz commented Jul 2, 2026

Copy link
Copy Markdown
Collaborator

Summary

Adds startup snapshot capture and restore support for the linux/amd64 KVM backend.

This includes:

  • capturing sparse guest memory plus KVM vCPU state, MSRs, FPU/LAPIC/XSAVE/XCRS, IRQ chip, PIT, clock, and virtio MMIO device state
  • restoring managed linux/amd64 sessions from a captured snapshot
  • wiring SnapshotDir and RestoreSnapshot through the linux/amd64 runtime backend
  • triggering snapshot capture from guest init through the configured snapshot MMIO page
  • making KVM managed run loops interruptible so session cleanup does not hang on cancellation
  • adding an integration test that captures a persistent Linux runtime snapshot, restores it, and executes a command

Closes #31.

Notes

Startup snapshots currently support one vCPU on linux/amd64. Multi-vCPU snapshot startup is rejected explicitly.

Validation

go test ./internal/hv/kvm ./internal/vm ./internal/cmd/init ./internal/vmruntime ./internal/virtio ./internal/managed/...

A local timing smoke check showed restore-to-ready around 35-43ms versus cold persistent Linux ready around 371-387ms with 256MB/1 CPU on this machine.

@Vbitz Vbitz force-pushed the codex/linux-amd64-startup-snapshots branch from 2a88cde to db7d35c Compare July 2, 2026 15:35
@Vbitz Vbitz marked this pull request as ready for review July 2, 2026 15:40
@Vbitz Vbitz force-pushed the codex/linux-amd64-startup-snapshots branch from db7d35c to 6f309a2 Compare July 2, 2026 15:43
@Vbitz Vbitz added this pull request to the merge queue Jul 2, 2026
Merged via the queue into main with commit 65abd74 Jul 2, 2026
11 checks passed
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.

Measure and optimize VM start time on Linux/KVM amd64

1 participant