Browse Source

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>
master
Vladimir Sementsov-Ogievskiy 4 months ago
parent
commit
9183dd1533
1 changed files with 3 additions and 0 deletions
  1. 3
    0
      qmp.c

+ 3
- 0
qmp.c View File

@@ -156,6 +156,9 @@ void qmp_cont(Error **errp)
156 156
         return;
157 157
     } else if (runstate_check(RUN_STATE_SUSPENDED)) {
158 158
         return;
159
+    } else if (runstate_check(RUN_STATE_FINISH_MIGRATE)) {
160
+        error_setg(errp, "Migration is not finalized yet");
161
+        return;
159 162
     }
160 163
 
161 164
     for (blk = blk_next(NULL); blk; blk = blk_next(blk)) {

Loading…
Cancel
Save