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>
---
0 files changed
diff --git a/replay/replay.c b/replay/replay.c
index 53edad1377..83ed9e0e24 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);
ping On 22.05.2020 09:45, Pavel Dovgalyuk wrote: > 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> > --- > 0 files changed > > diff --git a/replay/replay.c b/replay/replay.c > index 53edad1377..83ed9e0e24 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); > >
On 22/05/20 08:45, Pavel Dovgalyuk wrote: > 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> > --- > 0 files changed > > diff --git a/replay/replay.c b/replay/replay.c > index 53edad1377..83ed9e0e24 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); > > Queued, thanks. Paolo
Patchew URL: https://patchew.org/QEMU/159012995470.27967.18129611453659045726.stgit@pasha-ThinkPad-X280/ Hi, This series failed the docker-quick@centos7 build test. Please find the testing commands and their output below. If you have Docker installed, you can probably reproduce it locally. === TEST SCRIPT BEGIN === #!/bin/bash make docker-image-centos7 V=1 NETWORK=1 time make docker-test-quick@centos7 SHOW_ENV=1 J=14 NETWORK=1 === TEST SCRIPT END === TEST iotest-qcow2: 117 socket_accept failed: Resource temporarily unavailable ** ERROR:/tmp/qemu-test/src/tests/qtest/libqtest.c:301:qtest_init_without_qmp_handshake: assertion failed: (s->fd >= 0 && s->qmp_fd >= 0) /tmp/qemu-test/src/tests/qtest/libqtest.c:166: kill_qemu() tried to terminate QEMU process but encountered exit status 1 (expected 0) ERROR - Bail out! ERROR:/tmp/qemu-test/src/tests/qtest/libqtest.c:301:qtest_init_without_qmp_handshake: assertion failed: (s->fd >= 0 && s->qmp_fd >= 0) make: *** [check-qtest-x86_64] Error 1 make: *** Waiting for unfinished jobs.... TEST iotest-qcow2: 120 TEST iotest-qcow2: 126 --- qemu-system-aarch64: cannot set up guest memory 'exynos4210.dram0': Cannot allocate memory Broken pipe /tmp/qemu-test/src/tests/qtest/libqtest.c:166: kill_qemu() tried to terminate QEMU process but encountered exit status 1 (expected 0) ERROR - too few tests run (expected 66, got 4) make: *** [check-qtest-aarch64] Error 1 TEST iotest-qcow2: 156 TEST iotest-qcow2: 158 TEST iotest-qcow2: 159 --- raise CalledProcessError(retcode, cmd) subprocess.CalledProcessError: Command '['sudo', '-n', 'docker', 'run', '--label', 'com.qemu.instance.uuid=a6c6f5883f254d1c8850641570ca36ea', '-u', '1003', '--security-opt', 'seccomp=unconfined', '--rm', '-e', 'TARGET_LIST=', '-e', 'EXTRA_CONFIGURE_OPTS=', '-e', 'V=', '-e', 'J=14', '-e', 'DEBUG=', '-e', 'SHOW_ENV=1', '-e', 'CCACHE_DIR=/var/tmp/ccache', '-v', '/home/patchew2/.cache/qemu-docker-ccache:/var/tmp/ccache:z', '-v', '/var/tmp/patchew-tester-tmp-cngmh49y/src/docker-src.2020-05-22-07.09.39.22336:/var/tmp/qemu:z,ro', 'qemu:centos7', '/var/tmp/qemu/run', 'test-quick']' returned non-zero exit status 2. filter=--filter=label=com.qemu.instance.uuid=a6c6f5883f254d1c8850641570ca36ea make[1]: *** [docker-run] Error 1 make[1]: Leaving directory `/var/tmp/patchew-tester-tmp-cngmh49y/src' make: *** [docker-run-test-quick@centos7] Error 2 real 17m45.285s user 0m8.646s The full log is available at http://patchew.org/logs/159012995470.27967.18129611453659045726.stgit@pasha-ThinkPad-X280/testing.docker-quick@centos7/?type=message. --- Email generated automatically by Patchew [https://patchew.org/]. Please send your feedback to patchew-devel@redhat.com
© 2016 - 2025 Red Hat, Inc.