summaryrefslogtreecommitdiffstats
path: root/replay
diff options
context:
space:
mode:
authorPavel Dovgalyuk2019-07-25 10:44:32 +0200
committerPaolo Bonzini2019-08-20 17:26:21 +0200
commite957ad8aefa2a426c607683d4cac24bcee09ede4 (patch)
treeced2339b82f3a6271af14d0e57931b9ea3f761f4 /replay
parentutil/qemu-timer: refactor deadline calculation for external timers (diff)
downloadqemu-e957ad8aefa2a426c607683d4cac24bcee09ede4.tar.gz
qemu-e957ad8aefa2a426c607683d4cac24bcee09ede4.tar.xz
qemu-e957ad8aefa2a426c607683d4cac24bcee09ede4.zip
replay: fix replay shutdown
This patch fixes shutdown of the replay process, which is terminated with the assert when shutdown event is read from the log. replay_finish_event reads new data_kind and therefore the value of data_kind should be preserved to be valid at qemu_system_shutdown_request call. Signed-off-by: Pavel Dovgalyuk <Pavel.Dovgaluk@ispras.ru> Message-Id: <156404427238.18669.12378772823692338069.stgit@pasha-Precision-3630-Tower> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'replay')
-rw-r--r--replay/replay.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/replay/replay.c b/replay/replay.c
index 0c4e9c1318..69f973cd21 100644
--- a/replay/replay.c
+++ b/replay/replay.c
@@ -45,14 +45,14 @@ bool replay_next_event_is(int event)
}
while (true) {
- if (event == replay_state.data_kind) {
+ unsigned int data_kind = replay_state.data_kind;
+ if (event == data_kind) {
res = true;
}
- switch (replay_state.data_kind) {
+ switch (data_kind) {
case EVENT_SHUTDOWN ... EVENT_SHUTDOWN_LAST:
replay_finish_event();
- qemu_system_shutdown_request(replay_state.data_kind -
- EVENT_SHUTDOWN);
+ qemu_system_shutdown_request(data_kind - EVENT_SHUTDOWN);
break;
default:
/* clock, time_t, checkpoint and other events */