[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v14 13/21] replay: shutdown event
From: |
Pavel Dovgalyuk |
Subject: |
[Qemu-devel] [PATCH v14 13/21] replay: shutdown event |
Date: |
Mon, 25 May 2015 15:08:30 +0300 |
User-agent: |
StGit/0.16 |
This patch records and replays simulator shutdown event.
Reviewed-by: Paolo Bonzini <address@hidden>
Signed-off-by: Pavel Dovgalyuk <address@hidden>
---
replay/replay-internal.h | 2 ++
replay/replay.c | 14 ++++++++++++++
replay/replay.h | 5 +++++
vl.c | 1 +
4 files changed, 22 insertions(+), 0 deletions(-)
diff --git a/replay/replay-internal.h b/replay/replay-internal.h
index a79f4af..92d4749 100755
--- a/replay/replay-internal.h
+++ b/replay/replay-internal.h
@@ -23,6 +23,8 @@ enum ReplayEvents {
EVENT_EXCEPTION,
/* for async events */
EVENT_ASYNC,
+ /* for shutdown request */
+ EVENT_SHUTDOWN,
/* for clock read/writes */
/* some of grteater codes are reserved for clocks */
EVENT_CLOCK,
diff --git a/replay/replay.c b/replay/replay.c
index c7bd0ec..5c3a8c9 100755
--- a/replay/replay.c
+++ b/replay/replay.c
@@ -13,6 +13,7 @@
#include "replay.h"
#include "replay-internal.h"
#include "qemu/timer.h"
+#include "sysemu/sysemu.h"
ReplayMode replay_mode = REPLAY_MODE_NONE;
@@ -33,6 +34,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;
@@ -144,3 +149,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();
+ }
+}
diff --git a/replay/replay.h b/replay/replay.h
index 2398509..fcc93d1 100755
--- a/replay/replay.h
+++ b/replay/replay.h
@@ -66,6 +66,11 @@ int64_t replay_read_clock(ReplayClockKind kind);
? replay_save_clock((clock), (value)) \
: (value))
+/* Events */
+
+/*! Called when qemu shutdown is requested. */
+void replay_shutdown_request(void);
+
/* Asynchronous events queue */
/*! Disables storing events in the queue */
diff --git a/vl.c b/vl.c
index 15bccc4..3647439 100644
--- a/vl.c
+++ b/vl.c
@@ -1711,6 +1711,7 @@ void qemu_system_killed(int signal, pid_t pid)
void qemu_system_shutdown_request(void)
{
trace_qemu_system_shutdown_request();
+ replay_shutdown_request();
shutdown_requested = 1;
qemu_notify_event();
}
- [Qemu-devel] [PATCH v14 03/21] sysemu: system functions for replay, (continued)
- [Qemu-devel] [PATCH v14 03/21] sysemu: system functions for replay, Pavel Dovgalyuk, 2015/05/25
- [Qemu-devel] [PATCH v14 04/21] replay: internal functions for replay log, Pavel Dovgalyuk, 2015/05/25
- [Qemu-devel] [PATCH v14 05/21] replay: introduce mutex to protect the replay log, Pavel Dovgalyuk, 2015/05/25
- [Qemu-devel] [PATCH v14 06/21] replay: introduce icount event, Pavel Dovgalyuk, 2015/05/25
- [Qemu-devel] [PATCH v14 07/21] cpu-exec: allow temporary disabling icount, Pavel Dovgalyuk, 2015/05/25
- [Qemu-devel] [PATCH v14 08/21] cpu: replay instructions sequence, Pavel Dovgalyuk, 2015/05/25
- [Qemu-devel] [PATCH v14 09/21] i386: interrupt poll processing, Pavel Dovgalyuk, 2015/05/25
- [Qemu-devel] [PATCH v14 10/21] replay: interrupts and exceptions, Pavel Dovgalyuk, 2015/05/25
- [Qemu-devel] [PATCH v14 11/21] replay: asynchronous events infrastructure, Pavel Dovgalyuk, 2015/05/25
- [Qemu-devel] [PATCH v14 12/21] replay: recording and replaying clock ticks, Pavel Dovgalyuk, 2015/05/25
- [Qemu-devel] [PATCH v14 13/21] replay: shutdown event,
Pavel Dovgalyuk <=
- [Qemu-devel] [PATCH v14 14/21] replay: checkpoints, Pavel Dovgalyuk, 2015/05/25
- [Qemu-devel] [PATCH v14 15/21] bottom halves: introduce bh call function, Pavel Dovgalyuk, 2015/05/25
- [Qemu-devel] [PATCH v14 16/21] replay: ptimer, Pavel Dovgalyuk, 2015/05/25
- [Qemu-devel] [PATCH v14 17/21] typedef: add typedef for QemuOpts, Pavel Dovgalyuk, 2015/05/25
- [Qemu-devel] [PATCH v14 18/21] replay: initialization and deinitialization, Pavel Dovgalyuk, 2015/05/25
- [Qemu-devel] [PATCH v14 19/21] replay: replay blockers for devices, Pavel Dovgalyuk, 2015/05/25
- [Qemu-devel] [PATCH v14 20/21] replay: command line options, Pavel Dovgalyuk, 2015/05/25
- [Qemu-devel] [PATCH v14 21/21] replay: ptimer, Pavel Dovgalyuk, 2015/05/25
- Re: [Qemu-devel] [PATCH v14 00/21] Deterministic replay core, Paolo Bonzini, 2015/05/26