summaryrefslogtreecommitdiffstats
path: root/meta/lib
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 12:00:18 +0100
commit3408d0dc87d5cbaa80b7f090ca9c5063b6c5d56b (patch)
tree13ee07406d627bb9040eda9973aa22999b021350 /meta/lib
parent79e3418cadc2f5f64b19d73103abedf0b721bdf2 (diff)
downloadpoky-3408d0dc87d5cbaa80b7f090ca9c5063b6c5d56b.tar.gz
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. (From OE-Core rev: 0ead936925c61aaaa7a819f6c5b999ba3a4daeda) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib')
-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:
258 258
259 def stop(self): 259 def stop(self):
260 self.stop_thread() 260 self.stop_thread()
261 if self.runqemu: 261 if hasattr(self, "origchldhandler"):
262 signal.signal(signal.SIGCHLD, self.origchldhandler) 262 signal.signal(signal.SIGCHLD, self.origchldhandler)
263 if self.runqemu:
263 os.kill(self.monitorpid, signal.SIGKILL) 264 os.kill(self.monitorpid, signal.SIGKILL)
264 logger.info("Sending SIGTERM to runqemu") 265 logger.info("Sending SIGTERM to runqemu")
265 try: 266 try:
@@ -279,7 +280,6 @@ class QemuRunner:
279 self.server_socket = None 280 self.server_socket = None
280 self.qemupid = None 281 self.qemupid = None
281 self.ip = None 282 self.ip = None
282 signal.signal(signal.SIGCHLD, self.origchldhandler)
283 283
284 def stop_thread(self): 284 def stop_thread(self):
285 if self.thread and self.thread.is_alive(): 285 if self.thread and self.thread.is_alive():