Skip to content

qtest: don't leak pid files and UNIX domain sockets

Stefan Hajnoczi qemu-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 11 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2qtest: unlink QEMU pid file after startuptests/libqtest.c+11 -111 reply
2/2qtest: unlink UNIX domain sockets after connectingtests/libqtest.c+12 -110 replies

Reviews trailers per patch

None of the 2 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchMarkus Armbruster
SeriesR-b
1/2
2/2

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [Qemu-devel] [PATCH 0/2] qtest: don't leak pid files and UNIX domain sockets

GLib uses abort(3) to exit failed test cases. As a result, the pid file and UNIX domain sockets for a running test are leaked upon failure.

Since abort(3) does not call atexit(3) handler functions, we could set up a SIGABRT handler that performs cleanup. But there are other conditions where processes die, like SIGSEGV or SIGBUS.

Let's unlink pid files and UNIX domain sockets as soon as the QEMU process has initialized and connections have been made. This eliminates the possibility of leaking these files.

Note that the actual QEMU process is orphaned when a test case fails. This series does not fix that problem.

Stefan Hajnoczi (2):
qtest: unlink QEMU pid file after startup
qtest: unlink UNIX domain sockets after connecting

 tests/libqtest.c | 45 +++++++++++++++++++++++----------------------
 1 file changed, 23 insertions(+), 22 deletions(-)
Signature · 1 line
1.8.4.2