aboutsummaryrefslogtreecommitdiff
path: root/replay/replay-snapshot.c
diff options
context:
space:
mode:
Diffstat (limited to 'replay/replay-snapshot.c')
-rw-r--r--replay/replay-snapshot.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/replay/replay-snapshot.c b/replay/replay-snapshot.c
index 498059734d..65e2d375c2 100644
--- a/replay/replay-snapshot.c
+++ b/replay/replay-snapshot.c
@@ -59,3 +59,20 @@ void replay_vmstate_register(void)
{
vmstate_register(NULL, 0, &vmstate_replay, &replay_state);
}
+
+void replay_vmstate_init(void)
+{
+ if (replay_snapshot) {
+ if (replay_mode == REPLAY_MODE_RECORD) {
+ if (save_vmstate(cur_mon, replay_snapshot) != 0) {
+ error_report("Could not create snapshot for icount record");
+ exit(1);
+ }
+ } else if (replay_mode == REPLAY_MODE_PLAY) {
+ if (load_vmstate(replay_snapshot) != 0) {
+ error_report("Could not load snapshot for icount replay");
+ exit(1);
+ }
+ }
+ }
+}