diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-09-26 17:49:25 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-09-28 11:58:19 +0100 |
commit | 0ead936925c61aaaa7a819f6c5b999ba3a4daeda (patch) | |
tree | caf9857a1121eeb32658069859361b94c0604147 /meta/lib/oeqa/utils | |
parent | 823ce9555ee78aa460d0560b8fd9b309cfd36997 (diff) | |
download | openembedded-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.py | 4 |
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(): |