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 f6e1007288..cb0be5603c 100644
--- a/meta/lib/oeqa/utils/qemurunner.py
+++ b/meta/lib/oeqa/utils/qemurunner.py
@@ -534,6 +534,10 @@ class QemuRunner:
534 self.thread.stop() 534 self.thread.stop()
535 self.thread.join() 535 self.thread.join()
536 536
537 def allowexit(self):
538 if self.thread:
539 self.thread.allowexit()
540
537 def restart(self, qemuparams = None): 541 def restart(self, qemuparams = None):
538 self.logger.warning("Restarting qemu process") 542 self.logger.warning("Restarting qemu process")
539 if self.runqemu.poll() is None: 543 if self.runqemu.poll() is None:
@@ -630,6 +634,7 @@ class LoggingThread(threading.Thread):
630 self.logger = logger 634 self.logger = logger
631 self.readsock = None 635 self.readsock = None
632 self.running = False 636 self.running = False
637 self.canexit = False
633 638
634 self.errorevents = select.POLLERR | select.POLLHUP | select.POLLNVAL 639 self.errorevents = select.POLLERR | select.POLLHUP | select.POLLNVAL
635 self.readevents = select.POLLIN | select.POLLPRI 640 self.readevents = select.POLLIN | select.POLLPRI
@@ -663,6 +668,9 @@ class LoggingThread(threading.Thread):
663 self.close_ignore_error(self.writepipe) 668 self.close_ignore_error(self.writepipe)
664 self.running = False 669 self.running = False
665 670
671 def allowexit(self):
672 self.canexit = True
673
666 def eventloop(self): 674 def eventloop(self):
667 poll = select.poll() 675 poll = select.poll()
668 event_read_mask = self.errorevents | self.readevents 676 event_read_mask = self.errorevents | self.readevents
@@ -719,7 +727,9 @@ class LoggingThread(threading.Thread):
719 # happened. But for this code it counts as an 727 # happened. But for this code it counts as an
720 # error since the connection shouldn't go away 728 # error since the connection shouldn't go away
721 # until qemu exits. 729 # until qemu exits.
722 raise Exception("Console connection closed unexpectedly") 730 if not self.canexit:
731 raise Exception("Console connection closed unexpectedly")
732 return ''
723 733
724 return data 734 return data
725 735