Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH] qemurunner: Handle qemu start failure correctly
@ 2015-09-26 16:49 Richard Purdie
  0 siblings, 0 replies; only message in thread
From: Richard Purdie @ 2015-09-26 16:49 UTC (permalink / raw)
  To: openembedded-core

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>

diff --git a/meta/lib/oeqa/utils/qemurunner.py b/meta/lib/oeqa/utils/qemurunner.py
index 41b4401..c2c1779 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 self.origchldhandler:
             signal.signal(signal.SIGCHLD, self.origchldhandler)
+        if self.runqemu:
             os.kill(self.monitorpid, signal.SIGKILL)
             logger.info("Output from runqemu:\n%s" % self.getOutput(self.runqemu.stdout))
             logger.info("Sending SIGTERM to runqemu")
@@ -280,7 +281,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():




^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2015-09-26 16:49 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-26 16:49 [PATCH] qemurunner: Handle qemu start failure correctly Richard Purdie

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox