]> code.ossystems Code Review - openembedded-core.git/commit
runqemu: add SIGTERM handler to make sure things are cleaned up
authorChen Qi <Qi.Chen@windriver.com>
Thu, 7 Jun 2018 07:52:46 +0000 (15:52 +0800)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 18 Oct 2018 10:08:46 +0000 (11:08 +0100)
commit05c2a590980819e31acee29e1e7282d2ed3586b7
treee0d02d593a0b1e903c728d43ed979d2e92e09b98
parent6681ba9759b2d09945e415daf251162ac9600df7
runqemu: add SIGTERM handler to make sure things are cleaned up

Add SIGTERM handler so that runqemu could clean things up correctly
when receving such signal.

This problem was originally observed when running testimage. On
some hosts, after running testimage task, the user has to manually
operate on the tap interface (e.g. `sudo ip link del tap0') in order
for the next runqemu command to launch successfully.

The problem is about runqemu, SIGTERM and network manager on the host.

In testimage task, the runqemu process will receive SIGTERM. In such
situation, its cleanup() function is not run, resulting in tap interface
not cleaned up. On some hosts, the network manager will bring down the
tap interface automatically, thus this problem. I saw this problem on
Fedora21.

I think we'd better just clean up the tap interface ourselves.

So this patch adds to runqemu a SIGTERM handler, in which the actual
qemu process is terminated and other things cleaned up.

(From OE-Core rev: 02709d4709c56f9b9095e3555da35b659b03a8a3)

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
scripts/runqemu