aboutsummaryrefslogtreecommitdiff
path: root/migration
diff options
context:
space:
mode:
Diffstat (limited to 'migration')
-rw-r--r--migration/savevm.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/migration/savevm.c b/migration/savevm.c
index f1a11f742d..f417cef7d5 100644
--- a/migration/savevm.c
+++ b/migration/savevm.c
@@ -54,6 +54,7 @@
#include "qemu/cutils.h"
#include "io/channel-buffer.h"
#include "io/channel-file.h"
+#include "sysemu/replay.h"
#ifndef ETH_P_RARP
#define ETH_P_RARP 0x8035
@@ -2207,6 +2208,12 @@ int save_snapshot(const char *name, Error **errp)
struct tm tm;
AioContext *aio_context;
+ if (!replay_can_snapshot()) {
+ error_report("Record/replay does not allow making snapshot "
+ "right now. Try once more later.");
+ return ret;
+ }
+
if (!bdrv_all_can_snapshot(&bs)) {
error_setg(errp, "Device '%s' is writable but does not support "
"snapshots", bdrv_get_device_name(bs));
@@ -2398,6 +2405,12 @@ int load_snapshot(const char *name, Error **errp)
AioContext *aio_context;
MigrationIncomingState *mis = migration_incoming_get_current();
+ if (!replay_can_snapshot()) {
+ error_report("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",