diff options
author | Pavel Dovgalyuk <Pavel.Dovgaluk@ispras.ru> | 2015-09-17 19:24:33 +0300 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2015-11-06 10:16:02 +0100 |
commit | b60c48a7019614902f2debe4d4181ec8cfa60e0d (patch) | |
tree | 954f4fdccaa789c4ada10e6746e279b2b4467d59 /replay/replay.c | |
parent | 8eda206e09089914006bfbdd71467d5246c06e4a (diff) | |
download | qemu-b60c48a7019614902f2debe4d4181ec8cfa60e0d.zip qemu-b60c48a7019614902f2debe4d4181ec8cfa60e0d.tar.gz qemu-b60c48a7019614902f2debe4d4181ec8cfa60e0d.tar.bz2 |
replay: shutdown event
This patch records and replays simulator shutdown event.
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Pavel Dovgalyuk <pavel.dovgaluk@ispras.ru>
Message-Id: <20150917162433.8676.32262.stgit@PASHA-ISP.def.inno>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Pavel Dovgalyuk <Pavel.Dovgaluk@ispras.ru>
Diffstat (limited to 'replay/replay.c')
-rw-r--r-- | replay/replay.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/replay/replay.c b/replay/replay.c index b4fc64a..65dca7f 100644 --- a/replay/replay.c +++ b/replay/replay.c @@ -14,6 +14,7 @@ #include "replay-internal.h" #include "qemu/timer.h" #include "qemu/main-loop.h" +#include "sysemu/sysemu.h" ReplayMode replay_mode = REPLAY_MODE_NONE; @@ -34,6 +35,10 @@ bool replay_next_event_is(int event) res = true; } switch (replay_data_kind) { + case EVENT_SHUTDOWN: + replay_finish_event(); + qemu_system_shutdown_request(); + break; default: /* clock, time_t, checkpoint and other events */ return res; @@ -146,3 +151,12 @@ bool replay_has_interrupt(void) } return res; } + +void replay_shutdown_request(void) +{ + if (replay_mode == REPLAY_MODE_RECORD) { + replay_mutex_lock(); + replay_put_event(EVENT_SHUTDOWN); + replay_mutex_unlock(); + } +} |