]> code.ossystems Code Review - openembedded-core.git/commit
qemurunner: Ensure runqemu doesn't survive SIGKILL
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 8 Sep 2015 22:35:04 +0000 (23:35 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 9 Sep 2015 13:24:59 +0000 (14:24 +0100)
commit99428eafb5352bd39bc4329bdba07c6d6f17b03f
treef1a6a0065b27b9c0fd3549df8d696796e036f02a
parenta3c322b42c7a14584a80e04519c34689ec813210
qemurunner: Ensure runqemu doesn't survive SIGKILL

Currently, we see runqemu and qemu-system-* processes left behind when
bitbake is killed by buildbot. This is due to the use of setpgrp() in
the runqemu subprocess call.

We need the setpgrp call so that all runqemu processes can easily be
killed (by killing their process group). This presents a problem if this
controlling process itself is killed however since those processes don't
notice the death of the parent and merrily continue on.

Rather than hack runqemu to deal with this, we add something to
qemurunner, at least for now to resolve the issue. Basically we fork off
another process which holds an open pipe to the parent and also is
setpgrp. If/when the pipe sees EOF from the parent dieing, it kills the
process group. This is like pctrl's PDEATHSIG but for a process group
rather than a single process.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/lib/oeqa/utils/qemurunner.py