[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [RFC PATCH v5 24/31] replay: shutdown event
From: |
Pavel Dovgalyuk |
Subject: |
[Qemu-devel] [RFC PATCH v5 24/31] replay: shutdown event |
Date: |
Wed, 26 Nov 2014 13:41:01 +0300 |
User-agent: |
StGit/0.16 |
This patch records and replays simulator shutdown event.
Signed-off-by: Pavel Dovgalyuk <address@hidden>
---
include/sysemu/sysemu.h | 1 +
replay/replay-internal.h | 2 ++
replay/replay.c | 11 +++++++++++
replay/replay.h | 5 +++++
vl.c | 8 +++++++-
5 files changed, 26 insertions(+), 1 deletions(-)
diff --git a/include/sysemu/sysemu.h b/include/sysemu/sysemu.h
index 0037a69..bf4b1bd 100644
--- a/include/sysemu/sysemu.h
+++ b/include/sysemu/sysemu.h
@@ -57,6 +57,7 @@ void qemu_register_suspend_notifier(Notifier *notifier);
void qemu_system_wakeup_request(WakeupReason reason);
void qemu_system_wakeup_enable(WakeupReason reason, bool enabled);
void qemu_register_wakeup_notifier(Notifier *notifier);
+void qemu_system_shutdown_request_impl(void);
void qemu_system_shutdown_request(void);
void qemu_system_powerdown_request(void);
void qemu_register_powerdown_notifier(Notifier *notifier);
diff --git a/replay/replay-internal.h b/replay/replay-internal.h
index 009029d..ec6973d 100755
--- a/replay/replay-internal.h
+++ b/replay/replay-internal.h
@@ -20,6 +20,8 @@
#define EVENT_TM 2
/* for software interrupt */
#define EVENT_INTERRUPT 15
+/* for shutdown request */
+#define EVENT_SHUTDOWN 20
/* for emulated exceptions */
#define EVENT_EXCEPTION 23
/* for async events */
diff --git a/replay/replay.c b/replay/replay.c
index a6de6a1..c118f62 100755
--- a/replay/replay.c
+++ b/replay/replay.c
@@ -43,6 +43,10 @@ bool skip_async_events(int stop_event)
res = true;
}
switch (replay_data_kind) {
+ case EVENT_SHUTDOWN:
+ replay_has_unread_data = 0;
+ qemu_system_shutdown_request_impl();
+ break;
case EVENT_INSTRUCTION:
replay_state.instructions_count = replay_get_dword();
return res;
@@ -139,3 +143,10 @@ bool replay_has_interrupt(void)
}
return false;
}
+
+void replay_shutdown_request(void)
+{
+ if (replay_mode == REPLAY_MODE_RECORD) {
+ replay_put_event(EVENT_SHUTDOWN);
+ }
+}
diff --git a/replay/replay.h b/replay/replay.h
index 0c02e03..00c9906 100755
--- a/replay/replay.h
+++ b/replay/replay.h
@@ -78,6 +78,11 @@ void replay_save_tm(struct tm *tm);
/*! Reads struct tm value from the log. Stops execution in case of error */
void replay_read_tm(struct tm *tm);
+/* 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 37c6616..4155342 100644
--- a/vl.c
+++ b/vl.c
@@ -1792,13 +1792,19 @@ void qemu_system_killed(int signal, pid_t pid)
qemu_system_shutdown_request();
}
-void qemu_system_shutdown_request(void)
+void qemu_system_shutdown_request_impl(void)
{
trace_qemu_system_shutdown_request();
shutdown_requested = 1;
qemu_notify_event();
}
+void qemu_system_shutdown_request(void)
+{
+ replay_shutdown_request();
+ qemu_system_shutdown_request_impl();
+}
+
static void qemu_system_powerdown(void)
{
qapi_event_send_powerdown(&error_abort);
- Re: [Qemu-devel] [RFC PATCH v5 20/31] replay: recording and replaying clock ticks, (continued)
[Qemu-devel] [RFC PATCH v5 21/31] replay: recording and replaying different timers, Pavel Dovgalyuk, 2014/11/26
[Qemu-devel] [RFC PATCH v5 22/31] timer: introduce new QEMU_CLOCK_VIRTUAL_RT clock, Pavel Dovgalyuk, 2014/11/26
[Qemu-devel] [RFC PATCH v5 23/31] cpus: make icount warp deterministic in replay mode, Pavel Dovgalyuk, 2014/11/26
[Qemu-devel] [RFC PATCH v5 24/31] replay: shutdown event,
Pavel Dovgalyuk <=
[Qemu-devel] [RFC PATCH v5 25/31] replay: checkpoints, Pavel Dovgalyuk, 2014/11/26
[Qemu-devel] [RFC PATCH v5 26/31] replay: bottom halves, Pavel Dovgalyuk, 2014/11/26
[Qemu-devel] [RFC PATCH v5 27/31] replay: replay aio requests, Pavel Dovgalyuk, 2014/11/26
[Qemu-devel] [RFC PATCH v5 28/31] replay: thread pool, Pavel Dovgalyuk, 2014/11/26
[Qemu-devel] [RFC PATCH v5 29/31] replay: initialization and deinitialization, Pavel Dovgalyuk, 2014/11/26
[Qemu-devel] [RFC PATCH v5 30/31] replay: command line options, Pavel Dovgalyuk, 2014/11/26
[Qemu-devel] [RFC PATCH v5 31/31] replay: recording of the user input, Pavel Dovgalyuk, 2014/11/26
Re: [Qemu-devel] [RFC PATCH v5 00/31] Deterministic replay and reverse execution, Pavel Dovgaluk, 2014/11/26
Re: [Qemu-devel] [RFC PATCH v5 00/31] Deterministic replay and reverse execution, Paolo Bonzini, 2014/11/26
Message not available