Add Windows hypervisor primitives - #428
Conversation
c9e657a to
4ab69ee
Compare
-->
✱ stlc build✅ go code · compare
✅ python code · compare
✅ typescript code · compare
Diagnostics: ❗ 0 new / 1 total error, 💡 0 new / 5 total note
Build metadata
This comment is auto-generated by stlc and is kept up to date as you push. |
hiroTamada
left a comment
There was a problem hiding this comment.
reviewed — the overall direction looks solid, but the PR currently conflicts with main; please rebase and recheck the overlapping process-liveness paths. a few findings:
Bugs
lib/hypervisor/qemu/config.go:14,60-63—BuildArgsremains exported but bypasses validation.BootModeUEFIwith nilFirmwarenow panics, while other invalid combinations can emit broken arguments. consider returning an error and validating here, or making this entry point private.lib/hypervisor/qemu/swtpm.go:23-75— a missing PID record is treated as proof that no priorswtpmexists. if Hypeman exits after starting the detached child but before publishingswtpm.pid, the next start can unlink its live socket and launch another process against the same TPM state. this should reconcile or fail closed on an existing socket/process before unlinking it; the socket-owner machinery now onmainmay help after the rebase.
Tests
lib/hypervisor/qemu/fork_test.go:20-60— the UEFI/TPM rewrite assertions use aMachineTypeMicroVMsnapshot, which the new validation explicitly rejects. consider testing a standardq35snapshot so this covers a configuration that can actually be restored.lib/hypervisor/qemu/windows_config_integration_linux_test.go:97-114— afterStartVMsucceeds, a subsequentrequirefailure leaves detached QEMU andswtpmprocesses alive; the outer cleanup only removes the directory. register best-effort process cleanup immediately after startup, especially because CI retries this test three times.
hiroTamada
left a comment
There was a problem hiding this comment.
this is so fucking awesome
# Conflicts: # lib/oapi/oapi.go
# Conflicts: # lib/hypervisor/qemu/process.go # lib/oapi/oapi.go # stainless/custom-code/go/2026-08-21T19-11-19-339Z-custom-code.json # stainless/custom-code/python/2026-08-17T14-04-38-940Z-custom-code.json # stainless/custom-code/typescript/2026-08-21T19-11-20-278Z-custom-code.json
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit a8362e3. Configure here.

summary
targeted tests
go test ./lib/hypervisor/qemu ./lib/hypervisor ./lib/paths ./lib/instances ./cmd/api/api -run ... -count=1Long-running KVM and full CI suites were not run for this review pass.
Note
Medium Risk
Touches VM boot orchestration (swtpm/QEMU ordering, process reconciliation) and shared config validation used by all hypervisor starters; mistakes could break Linux direct-kernel paths or leave orphaned TPM processes.
Overview
Adds Windows-oriented hypervisor primitives on standard amd64 QEMU: UEFI firmware boot (OVMF code/vars, optional Secure Boot with
smm=on), qcow2 disks, and a per-instance software TPM 2.0 viaswtpmstarted before QEMU on a shared cleanup stack.VMConfiggainsBootMode,Firmware,TPM, and diskFormat, with sharedValidateBootConfig/ValidateDirectRawConfigso Cloud Hypervisor, Firecracker, and vz reject UEFI, TPM, and non-raw disks. QEMU profiles advertiseSupportsUEFIBoot/SupportsTPMon q35 only; microvm stays direct-kernel/raw.Observability & API: instance logs accept
source=swtpm(OpenAPI + API handler); README documentshypeman logs --source swtpm.CI installs
ovmf/swtpm, exports OVMF paths, and runsTestWindowsConfigIntegration(KVM) with retries. QMP socket wait extended to 30s; fork/snapshot path rewriting covers firmware and TPM paths.Reviewed by Cursor Bugbot for commit f4b75cb. Bugbot is set up for automated code reviews on this repo. Configure here.