[oe-commits] Richard Purdie : qemurunner: Handle qemu start failure correctly

git at git.openembedded.org git at git.openembedded.org
Sat Sep 26 17:14:28 UTC 2015


Module: openembedded-core.git
Branch: master-next
Commit: d95fec7476769ed267e1cd6e644a70ce50fc944a
URL:    http://git.openembedded.org/?p=openembedded-core.git&a=commit;h=d95fec7476769ed267e1cd6e644a70ce50fc944a

Author: Richard Purdie <richard.purdie at linuxfoundation.org>
Date:   Sat Sep 26 17:49:25 2015 +0100

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 at linuxfoundation.org>

---

 meta/lib/oeqa/utils/qemurunner.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/meta/lib/oeqa/utils/qemurunner.py b/meta/lib/oeqa/utils/qemurunner.py
index 0357f99..d678b54 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("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():



More information about the Openembedded-commits mailing list