|
@@ -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();
|
|
|
|