aboutsummaryrefslogtreecommitdiff
path: root/vl.c
diff options
context:
space:
mode:
authorLaurent Vivier <lvivier@redhat.com>2019-10-17 12:18:06 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2019-10-23 17:50:27 +0200
commit1bd71dce4bf2d24d003780ef01eb5fc274d66703 (patch)
tree34bd46e3cb951aec6225d489322ac064ed49cb1e /vl.c
parente31db8aabece49b815c394a3a0ddb6bb1624a07a (diff)
downloadqemu-1bd71dce4bf2d24d003780ef01eb5fc274d66703.zip
qemu-1bd71dce4bf2d24d003780ef01eb5fc274d66703.tar.gz
qemu-1bd71dce4bf2d24d003780ef01eb5fc274d66703.tar.bz2
runstate: ignore exit request in finish migrate state
Trying to reboot a VM while a migration is running can move to the prelaunch state (because of the reset) while the runstate is in finish migrate state. As the logical step after the finish migrate is postmigrate, this can create an invalid state transition from prelaunch state to postmigrate state and this raises an error and aborts: invalid runstate transition: 'prelaunch' -> 'postmigrate' As we are not able to manage reset in finish migrate state the best we can do is to ignore any changes and delay them until the next state which should be postmigrate and which should allow this kind of transition. Reported-by: Lukáš Doktor <ldoktor@redhat.com> Suggested-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Signed-off-by: Laurent Vivier <lvivier@redhat.com> Message-Id: <20191017101806.3644-1-lvivier@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'vl.c')
-rw-r--r--vl.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/vl.c b/vl.c
index 4489cfb..4a7d011 100644
--- a/vl.c
+++ b/vl.c
@@ -1744,6 +1744,9 @@ static bool main_loop_should_exit(void)
RunState r;
ShutdownCause request;
+ if (runstate_check(RUN_STATE_FINISH_MIGRATE)) {
+ return false;
+ }
if (preconfig_exit_requested) {
if (runstate_check(RUN_STATE_PRECONFIG)) {
runstate_set(RUN_STATE_PRELAUNCH);