summaryrefslogtreecommitdiffstats
path: root/replay
diff options
context:
space:
mode:
authorPavel Dovgalyuk2020-05-22 08:45:54 +0200
committerPaolo Bonzini2020-06-12 17:20:15 +0200
commited5d7ff34a8cfafd8efe2aab4eeaf9bf789870e3 (patch)
treee666a28e5e61fb07aeff91b70990821afea9d02f /replay
parentexec/cpu-common: Move MUSB specific typedefs to 'hw/usb/hcd-musb.h' (diff)
downloadqemu-ed5d7ff34a8cfafd8efe2aab4eeaf9bf789870e3.tar.gz
qemu-ed5d7ff34a8cfafd8efe2aab4eeaf9bf789870e3.tar.xz
qemu-ed5d7ff34a8cfafd8efe2aab4eeaf9bf789870e3.zip
replay: fix replay shutdown for console mode
When QEMU is used without any graphical window, QEMU execution is terminated with the signal (e.g., Ctrl-C). Signal processing in QEMU does not include qemu_system_shutdown_request call. That is why shutdown event is not recorded by record/replay in this case. This patch adds shutdown event to the end of the record log. Now every replay will shutdown the machine at the end. Signed-off-by: Pavel Dovgalyuk <Pavel.Dovgaluk@ispras.ru> Message-Id: <159012995470.27967.18129611453659045726.stgit@pasha-ThinkPad-X280> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'replay')
-rw-r--r--replay/replay.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/replay/replay.c b/replay/replay.c
index 706c7b4f4b..7d93746c73 100644
--- a/replay/replay.c
+++ b/replay/replay.c
@@ -366,6 +366,11 @@ void replay_finish(void)
/* finalize the file */
if (replay_file) {
if (replay_mode == REPLAY_MODE_RECORD) {
+ /*
+ * Can't do it in the signal handler, therefore
+ * add shutdown event here for the case of Ctrl-C.
+ */
+ replay_shutdown_request(SHUTDOWN_CAUSE_HOST_SIGNAL);
/* write end event */
replay_put_event(EVENT_END);