aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>2019-01-24 15:25:24 +0300
committerKevin Wolf <kwolf@redhat.com>2019-05-20 17:08:56 +0200
commit9183dd15334f1eee46051bbdafc6ab9fbfc2efd5 (patch)
tree815f2c7ee07a574688f13144f2cb23241e090349
parent41ae31e3d7696ec639b8fd6c162846244eeaa511 (diff)
downloadqemu-9183dd15334f1eee46051bbdafc6ab9fbfc2efd5.zip
qemu-9183dd15334f1eee46051bbdafc6ab9fbfc2efd5.tar.gz
qemu-9183dd15334f1eee46051bbdafc6ab9fbfc2efd5.tar.bz2
qmp: forbid qmp_cont in RUN_STATE_FINISH_MIGRATE
qmp_cont in RUN_STATE_FINISH_MIGRATE may lead to moving vm to RUN_STATE_RUNNING, before actual migration finish. So, when migration thread will try to go to RUN_STATE_POSTMIGRATE, assuming transition RUN_STATE_FINISH_MIGRATE->RUN_STATE_POSTMIGRATE, it will crash, as current state is RUN_STATE_RUNNING, and transition RUN_STATE_RUNNING->RUN_STATE_POSTMIGRATE is forbidden. Reported-by: Max Reitz <mreitz@redhat.com> Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
-rw-r--r--qmp.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/qmp.c b/qmp.c
index b92d62c..fa1b3c1 100644
--- a/qmp.c
+++ b/qmp.c
@@ -156,6 +156,9 @@ void qmp_cont(Error **errp)
return;
} else if (runstate_check(RUN_STATE_SUSPENDED)) {
return;
+ } else if (runstate_check(RUN_STATE_FINISH_MIGRATE)) {
+ error_setg(errp, "Migration is not finalized yet");
+ return;
}
for (blk = blk_next(NULL); blk; blk = blk_next(blk)) {