qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 0/3] libqtest: solve QEMU process cleanup problem
@ 2014-07-24 16:39 Stefan Hajnoczi
  2014-07-24 16:39 ` [Qemu-devel] [PATCH 1/3] libqemustub: add qemu_system_shutdown_request() and no_shutdown Stefan Hajnoczi
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Stefan Hajnoczi @ 2014-07-24 16:39 UTC (permalink / raw)
  To: qemu-devel; +Cc: Andreas Faerber, Anthony Liguori

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 (3):
  libqemustub: add qemu_system_shutdown_request() and no_shutdown
  qemu-char: add -chardev exit-on-eof option
  libqtest: use -chardev exit-on-eof to clean up QEMU

 include/sysemu/char.h |  1 +
 qapi-schema.json      | 23 ++++++++++++++++-------
 qemu-char.c           | 34 ++++++++++++++++++++++++++++------
 qemu-options.hx       | 19 +++++++++++++------
 stubs/Makefile.objs   |  1 +
 stubs/shutdown.c      |  7 +++++++
 tests/libqtest.c      | 48 +++---------------------------------------------
 7 files changed, 69 insertions(+), 64 deletions(-)
 create mode 100644 stubs/shutdown.c

-- 
1.9.3

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2014-07-29 14:41 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-24 16:39 [Qemu-devel] [PATCH 0/3] libqtest: solve QEMU process cleanup problem Stefan Hajnoczi
2014-07-24 16:39 ` [Qemu-devel] [PATCH 1/3] libqemustub: add qemu_system_shutdown_request() and no_shutdown Stefan Hajnoczi
2014-07-24 17:07   ` Peter Maydell
2014-07-25  9:42     ` Stefan Hajnoczi
2014-07-24 16:39 ` [Qemu-devel] [PATCH 2/3] qemu-char: add -chardev exit-on-eof option Stefan Hajnoczi
2014-07-25  8:12   ` Markus Armbruster
2014-07-25  9:39     ` Stefan Hajnoczi
2014-07-28 23:08     ` Eric Blake
2014-07-29  6:12       ` Markus Armbruster
2014-07-29 12:58         ` Eric Blake
2014-07-29 14:41           ` Markus Armbruster
2014-07-24 16:39 ` [Qemu-devel] [PATCH 3/3] libqtest: use -chardev exit-on-eof to clean up QEMU Stefan Hajnoczi

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).