aboutsummaryrefslogtreecommitdiff
path: root/migration
diff options
context:
space:
mode:
authorPavel Dovgalyuk <Pavel.Dovgaluk@ispras.ru>2020-10-03 20:13:37 +0300
committerPaolo Bonzini <pbonzini@redhat.com>2020-10-06 08:34:49 +0200
commitf9a9fb6516b453d2318eca0fc5eecc4c57f6b065 (patch)
tree76a9663ec8e2e60c37898a9f244099d15f59d63e /migration
parentf6baed3d1485817e812ac8b275b5b4158384c59e (diff)
replay: flush rr queue before loading the vmstate
Non-empty record/replay queue prevents saving and loading the VM state, because it includes pending bottom halves and block coroutines. But when the new VM state is loaded, we don't have to preserve the consistency of the current state anymore. Therefore this patch just flushes the queue allowing the coroutines to finish and removes checking for empty rr queue for load_snapshot function. Signed-off-by: Pavel Dovgalyuk <Pavel.Dovgalyuk@ispras.ru> Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Message-Id: <160174521762.12451.15752448887893855757.stgit@pasha-ThinkPad-X280> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'migration')
-rw-r--r--migration/savevm.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/migration/savevm.c b/migration/savevm.c
index 0e8dc78684..d2e141f7b1 100644
--- a/migration/savevm.c
+++ b/migration/savevm.c
@@ -2881,12 +2881,6 @@ int load_snapshot(const char *name, Error **errp)
AioContext *aio_context;
MigrationIncomingState *mis = migration_incoming_get_current();
- if (!replay_can_snapshot()) {
- error_setg(errp, "Record/replay does not allow loading snapshot "
- "right now. Try once more later.");
- return -EINVAL;
- }
-
if (!bdrv_all_can_snapshot(&bs)) {
error_setg(errp,
"Device '%s' is writable but does not support snapshots",
@@ -2920,6 +2914,12 @@ int load_snapshot(const char *name, Error **errp)
return -EINVAL;
}
+ /*
+ * Flush the record/replay queue. Now the VM state is going
+ * to change. Therefore we don't need to preserve its consistency
+ */
+ replay_flush_events();
+
/* Flush all IO requests so they don't interfere with the new state. */
bdrv_drain_all_begin();