qemurunner: Remove the signal handler before stopping qemu

The qemu shutdown can race with the signal handler removal leading to
confusing tracebacks on slower/loaded systems.

Remove the signal handler first before shutting down.

(From OE-Core rev: 1b63ce7bb83134f84bf07d1075d5ca0d5466ed3d)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Richard Purdie 2018-10-05 12:05:04 +01:00
parent 9b48842834
commit b1b23359a3

View File

@ -350,10 +350,10 @@ class QemuRunner:
return True
def stop(self):
self.stop_thread()
self.stop_qemu_system()
if hasattr(self, "origchldhandler"):
signal.signal(signal.SIGCHLD, self.origchldhandler)
self.stop_thread()
self.stop_qemu_system()
if self.runqemu:
if hasattr(self, "monitorpid"):
os.kill(self.monitorpid, signal.SIGKILL)