]> 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>
Mon, 18 Jun 2018 09:59:33 +0000 (10:59 +0100)
commit02709d4709c56f9b9095e3555da35b659b03a8a3
tree55deb9ea52d75d0193c407a21d01020f90de0e3f
parent461c305078c40fca8b5382e393e3e8513d4abfa4
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.

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