Stefan Hajnoczi <stefa...@redhat.com> writes: > 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.
I guess for more reliable and complete cleanup, we'd need a monitor process that adopts and handles orphans, and removes left-behind files. To make the latter work, tests must create files only in a temporary directory the monitor process can then remove wholesale. Anyway, this series is a welcome improvement. Reviewed-by: Markus Armbruster <arm...@redhat.com>