summaryrefslogtreecommitdiff
path: root/meta/lib/oeqa/utils
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2015-09-26 17:49:25 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-09-28 11:58:19 +0100
commit0ead936925c61aaaa7a819f6c5b999ba3a4daeda (patch)
treecaf9857a1121eeb32658069859361b94c0604147 /meta/lib/oeqa/utils
parent823ce9555ee78aa460d0560b8fd9b309cfd36997 (diff)
downloadopenembedded-core-0ead936925c61aaaa7a819f6c5b999ba3a4daeda.tar.gz
openembedded-core-0ead936925c61aaaa7a819f6c5b999ba3a4daeda.tar.bz2
openembedded-core-0ead936925c61aaaa7a819f6c5b999ba3a4daeda.zip
qemurunner: Handle qemu start failure correctly
If qemu didn't start correctly, we may not have registered the child signal. This results in a nasty traceback which confuses the underlying issue. Cleanup this code and make the handler cleanup conditional. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa/utils')
-rw-r--r--meta/lib/oeqa/utils/qemurunner.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/meta/lib/oeqa/utils/qemurunner.py b/meta/lib/oeqa/utils/qemurunner.py
index 0357f99d92..5624977561 100644
--- a/meta/lib/oeqa/utils/qemurunner.py
+++ b/meta/lib/oeqa/utils/qemurunner.py
@@ -258,8 +258,9 @@ class QemuRunner:
def stop(self):
self.stop_thread()
- if self.runqemu:
+ if hasattr(self, "origchldhandler"):
signal.signal(signal.SIGCHLD, self.origchldhandler)
+ if self.runqemu:
os.kill(self.monitorpid, signal.SIGKILL)
logger.info("Sending SIGTERM to runqemu")
try:
@@ -279,7 +280,6 @@ class QemuRunner:
self.server_socket = None
self.qemupid = None
self.ip = None
- signal.signal(signal.SIGCHLD, self.origchldhandler)
def stop_thread(self):
if self.thread and self.thread.is_alive():