summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta/lib/oeqa/utils/qemurunner.py28
1 files changed, 14 insertions, 14 deletions
diff --git a/meta/lib/oeqa/utils/qemurunner.py b/meta/lib/oeqa/utils/qemurunner.py
index 6d36df6953..bcdb69b38c 100644
--- a/meta/lib/oeqa/utils/qemurunner.py
+++ b/meta/lib/oeqa/utils/qemurunner.py
@@ -139,6 +139,7 @@ class QemuRunner:
139 logger.info("Couldn't get ip from qemu process arguments! Here is the qemu command line used:\n%s\nand output from runqemu:\n%s" % (cmdline, getOutput(output))) 139 logger.info("Couldn't get ip from qemu process arguments! Here is the qemu command line used:\n%s\nand output from runqemu:\n%s" % (cmdline, getOutput(output)))
140 self.stop() 140 self.stop()
141 return False 141 return False
142 logger.info("qemu cmdline used:\n{}".format(cmdline))
142 logger.info("Target IP: %s" % self.ip) 143 logger.info("Target IP: %s" % self.ip)
143 logger.info("Server IP: %s" % self.server_ip) 144 logger.info("Server IP: %s" % self.server_ip)
144 145
@@ -368,6 +369,7 @@ class LoggingThread(threading.Thread):
368 os.write(self.writepipe, "stop") 369 os.write(self.writepipe, "stop")
369 370
370 def teardown(self): 371 def teardown(self):
372 self.logger.info("Tearing down logging thread")
371 self.close_socket(self.serversock) 373 self.close_socket(self.serversock)
372 374
373 if self.readsock is not None: 375 if self.readsock is not None:
@@ -412,25 +414,23 @@ class LoggingThread(threading.Thread):
412 414
413 # Actual data to be logged 415 # Actual data to be logged
414 elif self.readsock.fileno() == event[0]: 416 elif self.readsock.fileno() == event[0]:
415 data = self.recv_loop() 417 data = self.recv(1024)
416 self.logfunc(data) 418 self.logfunc(data)
417 419
418 # Since the socket is non-blocking make sure to honor EAGAIN 420 # Since the socket is non-blocking make sure to honor EAGAIN
419 # and EWOULDBLOCK 421 # and EWOULDBLOCK.
420 def recv_loop(self): 422 def recv(self, count):
421 while True: 423 try:
422 try: 424 data = self.readsock.recv(count)
423 data = self.readsock.recv(1024) 425 except socket.error as e:
424 break 426 if e.errno == errno.EAGAIN or e.errno == errno.EWOULDBLOCK:
425 except socket.error as e: 427 return ''
426 if e.errno == errno.EAGAIN or e.errno == errno.EWOULDBLOCK: 428 else:
427 continue 429 raise
428 else:
429 raise
430 430
431 if not data: 431 if data is None:
432 raise Exception("No data on read ready socket") 432 raise Exception("No data on read ready socket")
433 elif data == 0: 433 elif not data:
434 # This actually means an orderly shutdown 434 # This actually means an orderly shutdown
435 # happened. But for this code it counts as an 435 # happened. But for this code it counts as an
436 # error since the connection shouldn't go away 436 # error since the connection shouldn't go away