Before this change on a test failure an exception would be generated due
to runqemu being killed before the logging thread which was on the other
end of the socket.
The exception was actually correct saying there was no data on a socket
marked readable, but this was because the qemu process was killed before
the listener thread.
Signed-off-by: Randy Witt <randy.e.witt@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
def stop(self):
+ self.stop_thread()
if self.runqemu:
logger.info("Sending SIGTERM to runqemu")
try:
self.server_socket = None
self.qemupid = None
self.ip = None
- self.stop_thread()
def stop_thread(self):
if self.thread and self.thread.is_alive():
elif self.serversock.fileno() == event[0]:
self.logger.info("Connection request received")
self.readsock, _ = self.serversock.accept()
+ self.readsock.setblocking(0)
poll.unregister(self.serversock.fileno())
poll.register(self.readsock.fileno())