]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
colo: Forbid VM resume during checkpointing
authorPeter Xu <peterx@redhat.com>
Tue, 27 Jan 2026 18:52:37 +0000 (13:52 -0500)
committerFabiano Rosas <farosas@suse.de>
Tue, 17 Feb 2026 12:53:41 +0000 (09:53 -0300)
COLO will stop the VM during each checkpoint on either PVM or SVM.

Accidentally resuming the VM during the window might be fatal because it
may cause the RAM and devices state to misalign, corrupting the checkpoint.

Hence forbid VM resume during the process.

Reviewed-by: Fabiano Rosas <farosas@suse.de>
Signed-off-by: Peter Xu <peterx@redhat.com>
Tested-by: Lukas Straub <lukasstraub2@web.de>
Link: https://lore.kernel.org/qemu-devel/20260127185254.3954634-8-peterx@redhat.com
Signed-off-by: Fabiano Rosas <farosas@suse.de>
monitor/qmp-cmds.c

index 1ca44fbd72f423e231b4bc59eee8e7148feb227d..0c409c27dc3b7d37c0f3f8bb2da5a610eb4348a3 100644 (file)
@@ -84,6 +84,9 @@ void qmp_cont(Error **errp)
     } else if (runstate_check(RUN_STATE_FINISH_MIGRATE)) {
         error_setg(errp, "Migration is not finalized yet");
         return;
+    } else if (runstate_check(RUN_STATE_COLO)) {
+        error_setg(errp, "COLO checkpoint in progress");
+        return;
     }
 
     for (blk = blk_next(NULL); blk; blk = blk_next(blk)) {