summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/utils/qemurunner.py
diff options
context:
space:
mode:
Diffstat (limited to 'meta/lib/oeqa/utils/qemurunner.py')
-rw-r--r--meta/lib/oeqa/utils/qemurunner.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/meta/lib/oeqa/utils/qemurunner.py b/meta/lib/oeqa/utils/qemurunner.py
index 278904ba0b..84f7c5e76d 100644
--- a/meta/lib/oeqa/utils/qemurunner.py
+++ b/meta/lib/oeqa/utils/qemurunner.py
@@ -471,6 +471,10 @@ class QemuRunner:
471 self.thread.stop() 471 self.thread.stop()
472 self.thread.join() 472 self.thread.join()
473 473
474 def allowexit(self):
475 if self.thread:
476 self.thread.allowexit()
477
474 def restart(self, qemuparams = None): 478 def restart(self, qemuparams = None):
475 self.logger.warning("Restarting qemu process") 479 self.logger.warning("Restarting qemu process")
476 if self.runqemu.poll() is None: 480 if self.runqemu.poll() is None:
@@ -564,6 +568,7 @@ class LoggingThread(threading.Thread):
564 self.logger = logger 568 self.logger = logger
565 self.readsock = None 569 self.readsock = None
566 self.running = False 570 self.running = False
571 self.canexit = False
567 572
568 self.errorevents = select.POLLERR | select.POLLHUP | select.POLLNVAL 573 self.errorevents = select.POLLERR | select.POLLHUP | select.POLLNVAL
569 self.readevents = select.POLLIN | select.POLLPRI 574 self.readevents = select.POLLIN | select.POLLPRI
@@ -597,6 +602,9 @@ class LoggingThread(threading.Thread):
597 self.close_ignore_error(self.writepipe) 602 self.close_ignore_error(self.writepipe)
598 self.running = False 603 self.running = False
599 604
605 def allowexit(self):
606 self.canexit = True
607
600 def eventloop(self): 608 def eventloop(self):
601 poll = select.poll() 609 poll = select.poll()
602 event_read_mask = self.errorevents | self.readevents 610 event_read_mask = self.errorevents | self.readevents
@@ -653,7 +661,9 @@ class LoggingThread(threading.Thread):
653 # happened. But for this code it counts as an 661 # happened. But for this code it counts as an
654 # error since the connection shouldn't go away 662 # error since the connection shouldn't go away
655 # until qemu exits. 663 # until qemu exits.
656 raise Exception("Console connection closed unexpectedly") 664 if not self.canexit:
665 raise Exception("Console connection closed unexpectedly")
666 return ''
657 667
658 return data 668 return data
659 669