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>
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:
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():