From: Stefan Hajnoczi <stefanha@redhat.com>
To: qemu-devel@nongnu.org
Cc: Peter Maydell <peter.maydell@linaro.org>,
Andreas Faerber <afaerber@suse.de>,
Markus Armbruster <armbru@redhat.com>
Subject: [Qemu-devel] [PATCH v2 0/4] libqtest: solve QEMU process cleanup problem
Date: Fri, 25 Jul 2014 14:16:42 +0100 [thread overview]
Message-ID: <1406294206-26679-1-git-send-email-stefanha@redhat.com> (raw)
v2:
* Added qemu_system_shutdown_force() API [Peter]
Test cases are supposed to clean up even if they fail. Historically libqtest
has leaked QEMU processes and files. This caused annoyances and buildbot
failures so it was gradually fixed.
The solution we have for terminating the QEMU process if the test case fails
was not very satisfactory. A SIGABRT handler in the test case sends SIGTERM to
QEMU. This only works if the test case receives SIGABRT, not other ways in
which it could die. The approach is ugly because it installs a global signal
handler although libqtest is supposed to support multiple simultaneous
instances.
This patch series adds the new -chardev exit-on-eof option. QEMU will
terminate if the socket/pipe/stdio receives EOF. That happens when the test
case process terminates for any reason. By adding this option to -chardev we
can use it with both -qtest and -qmp.
Stefan Hajnoczi (4):
vl: add qemu_system_shutdown_force()
libqemustub: add qemu_system_shutdown_force()
qemu-char: add -chardev exit-on-eof option
libqtest: use -chardev exit-on-eof to clean up QEMU
include/sysemu/char.h | 1 +
include/sysemu/sysemu.h | 2 +-
qapi-schema.json | 23 ++++++++++++++++-------
qemu-char.c | 33 +++++++++++++++++++++++++++------
qemu-options.hx | 19 +++++++++++++------
qmp.c | 3 +--
stubs/Makefile.objs | 1 +
stubs/shutdown.c | 5 +++++
tests/libqtest.c | 48 +++---------------------------------------------
ui/sdl.c | 3 +--
ui/sdl2.c | 6 ++----
vl.c | 11 ++++++++---
12 files changed, 79 insertions(+), 76 deletions(-)
create mode 100644 stubs/shutdown.c
--
1.9.3
next reply other threads:[~2014-07-25 13:17 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-25 13:16 Stefan Hajnoczi [this message]
2014-07-25 13:16 ` [Qemu-devel] [PATCH v2 1/4] vl: add qemu_system_shutdown_force() Stefan Hajnoczi
2014-07-25 13:16 ` [Qemu-devel] [PATCH v2 2/4] libqemustub: " Stefan Hajnoczi
2014-07-25 13:16 ` [Qemu-devel] [PATCH v2 3/4] qemu-char: add -chardev exit-on-eof option Stefan Hajnoczi
2014-07-28 21:21 ` Eric Blake
2014-07-25 13:16 ` [Qemu-devel] [PATCH v2 4/4] libqtest: use -chardev exit-on-eof to clean up QEMU Stefan Hajnoczi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1406294206-26679-1-git-send-email-stefanha@redhat.com \
--to=stefanha@redhat.com \
--cc=afaerber@suse.de \
--cc=armbru@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).