Skip to content

Add standby / restore support for Mac vz hypervisor#115

Open
sjmiller609 wants to merge 3 commits intomainfrom
codex/mac-standby-support
Open

Add standby / restore support for Mac vz hypervisor#115
sjmiller609 wants to merge 3 commits intomainfrom
codex/mac-standby-support

Conversation

@sjmiller609
Copy link
Collaborator

@sjmiller609 sjmiller609 commented Feb 27, 2026

Summary

  • teach the VZ shim about save/restore state, snapshot manifest handling, and platform configuration so standbys serialize RAM on macOS 14+ ARM
  • extend the higher-level VZ hypervisor client and starter to expose Snapshot()/RestoreVM() plus runtime validation and manifest wiring
  • document the new behavior and add an integration test that exercises the full VZ standby/restore cycle

Testing

  • Added integration test

Note

Medium Risk
Adds save/restore snapshotting to the vz hypervisor (stateful VM lifecycle and on-disk manifests), which can affect VM availability and data integrity if compatibility/validation or file handling is wrong. Scoped to macOS 14+ Apple Silicon and gated by capability checks, but still touches core VM lifecycle paths.

Overview
Enables standby/restore for the macOS vz hypervisor by adding a vz-shim PUT /api/v1/vm.snapshot endpoint that saves machine state to disk and writes a snapshot manifest (config.json) for later restore.

Adds restore boot flow to vz-shim (start vs restore based on RestoreMachineStatePath), persists platform identity via a stable generic machine identifier, disables the memory balloon device to improve save/restore compatibility, and extends VM state reporting to include save/restore-related states.

Wires this through lib/hypervisor/vz: Client.Snapshot() is implemented with a long-running HTTP client and Capabilities().SupportsSnapshot becomes arm64-only; Starter.RestoreVM() is implemented to read the manifest and start the shim in restore mode. Adds a darwin/arm64 integration test covering the full standby→restore cycle, updates docs/README wording, and makes Go test timeouts configurable via GO_TEST_TIMEOUT (set to 600s in CI).

Written by Cursor Bugbot for commit 6909797. This will update automatically on new commits. Configure here.

@sjmiller609 sjmiller609 changed the title Add VZ snapshot/restore support and tests Add standby / restore support for Mac vz hypervisor Feb 28, 2026
@sjmiller609 sjmiller609 enabled auto-merge (squash) February 28, 2026 00:40
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

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.

1 participant