From e79c190cfe167ccf44d9ca9a0d4a25a1f0e4cb99 Mon Sep 17 00:00:00 2001 From: Nwflower <1679659@qq.com> Date: Fri, 4 Dec 2026 03:15:30 -0700 Subject: [PATCH] docs(suspend): record the older start path refusing a resumed snapshot The older start path cannot resume a snapshot, so it now refuses to start a VM that still holds a recoverable one instead of cold-starting over it. Say so in the change entry and at the guard, where the reason stays next to the code. --- changes/fix-suspend-stale-tmp-and-seal-retry.json | 4 ++-- internal/app/macos_lifecycle_native.go | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/changes/fix-suspend-stale-tmp-and-seal-retry.json b/changes/fix-suspend-stale-tmp-and-seal-retry.json index a6c4221..375216c 100644 --- a/changes/fix-suspend-stale-tmp-and-seal-retry.json +++ b/changes/fix-suspend-stale-tmp-and-seal-retry.json @@ -2,6 +2,6 @@ "group": "fixes", "order": 0, "authors": ["reiasu2", "Nwflower"], - "zh": "自动清理无法恢复的挂起残留,避免它们阻止再次挂起,并修复 Windows 上文件仍被短暂占用时挂起封存或清理失败的问题。挂起与恢复支持存放在长路径下的虚拟机。", - "en": "Clear orphaned suspend files that block later suspend attempts and avoid snapshot publication or cleanup failures when Windows files are briefly still in use. Suspend and resume also support VMs stored under long paths." + "zh": "自动清理无法恢复的挂起残留,避免它们阻止再次挂起,并修复 Windows 上文件仍被短暂占用时挂起封存或清理失败的问题。挂起与恢复支持存放在长路径下的虚拟机。已保存可恢复快照的虚拟机在启动时会改为拒绝并提示先恢复或放弃挂起状态,旧版启动入口同样适用,不再直接冷启动覆盖快照。", + "en": "Clear orphaned suspend files that block later suspend attempts and avoid snapshot publication or cleanup failures when Windows files are briefly still in use. Suspend and resume also support VMs stored under long paths. A VM that holds a recoverable snapshot now refuses to start and asks you to resume or discard that state first, including through the older start path, instead of cold-starting over the snapshot." } diff --git a/internal/app/macos_lifecycle_native.go b/internal/app/macos_lifecycle_native.go index afd8343..bd97097 100644 --- a/internal/app/macos_lifecycle_native.go +++ b/internal/app/macos_lifecycle_native.go @@ -444,6 +444,11 @@ func (a *App) reconcileLegacyBridgeArgs(ctx context.Context, c networkControlCli return nil } +// prepareLegacyColdStart guards the older start path against a stopped VM that +// still holds suspend artifacts. It drops provably orphaned files, then refuses +// the start while a recoverable snapshot remains: this path cannot resume one, +// and cold-starting over it would discard the guest's saved state. Resume or +// discard the snapshot from the UI first. func prepareLegacyColdStart(ctx context.Context, locale i18n.Locale, name, tmpDir string, cur reims.VMDetail, log func(string)) error { if cur.State != "stopped" { return nil