[PATCH 07/10] colo: Forbid VM resume during checkpointing

Peter Xu posted 10 patches 3 days, 11 hours ago
Maintainers: Hailiang Zhang <zhanghailiang@xfusion.com>, Peter Xu <peterx@redhat.com>, Fabiano Rosas <farosas@suse.de>, Markus Armbruster <armbru@redhat.com>
[PATCH 07/10] colo: Forbid VM resume during checkpointing
Posted by Peter Xu 3 days, 11 hours ago
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.

Signed-off-by: Peter Xu <peterx@redhat.com>
---
 monitor/qmp-cmds.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/monitor/qmp-cmds.c b/monitor/qmp-cmds.c
index 1ca44fbd72..0c409c27dc 100644
--- a/monitor/qmp-cmds.c
+++ b/monitor/qmp-cmds.c
@@ -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)) {
-- 
2.50.1
Re: [PATCH 07/10] colo: Forbid VM resume during checkpointing
Posted by Fabiano Rosas 1 day, 20 hours ago
Peter Xu <peterx@redhat.com> writes:

> 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.
>
> Signed-off-by: Peter Xu <peterx@redhat.com>
> ---
>  monitor/qmp-cmds.c | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/monitor/qmp-cmds.c b/monitor/qmp-cmds.c
> index 1ca44fbd72..0c409c27dc 100644
> --- a/monitor/qmp-cmds.c
> +++ b/monitor/qmp-cmds.c
> @@ -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)) {

Reviewed-by: Fabiano Rosas <farosas@suse.de>