diff options
Diffstat (limited to 'meta/lib/oeqa/utils/qemurunner.py')
| -rw-r--r-- | meta/lib/oeqa/utils/qemurunner.py | 18 |
1 files changed, 2 insertions, 16 deletions
diff --git a/meta/lib/oeqa/utils/qemurunner.py b/meta/lib/oeqa/utils/qemurunner.py index 0ef8cf0a79..22cf258ddd 100644 --- a/meta/lib/oeqa/utils/qemurunner.py +++ b/meta/lib/oeqa/utils/qemurunner.py | |||
| @@ -21,7 +21,6 @@ import threading | |||
| 21 | import codecs | 21 | import codecs |
| 22 | import logging | 22 | import logging |
| 23 | import tempfile | 23 | import tempfile |
| 24 | from oeqa.utils.dump import HostDumper | ||
| 25 | from collections import defaultdict | 24 | from collections import defaultdict |
| 26 | import importlib | 25 | import importlib |
| 27 | 26 | ||
| @@ -33,8 +32,8 @@ re_control_char = re.compile('[%s]' % re.escape("".join(control_chars))) | |||
| 33 | 32 | ||
| 34 | class QemuRunner: | 33 | class QemuRunner: |
| 35 | 34 | ||
| 36 | def __init__(self, machine, rootfs, display, tmpdir, deploy_dir_image, logfile, boottime, dump_dir, dump_host_cmds, | 35 | def __init__(self, machine, rootfs, display, tmpdir, deploy_dir_image, logfile, boottime, dump_dir, use_kvm, logger, use_slirp=False, |
| 37 | use_kvm, logger, use_slirp=False, serial_ports=2, boot_patterns = defaultdict(str), use_ovmf=False, workdir=None, tmpfsdir=None): | 36 | serial_ports=2, boot_patterns = defaultdict(str), use_ovmf=False, workdir=None, tmpfsdir=None): |
| 38 | 37 | ||
| 39 | # Popen object for runqemu | 38 | # Popen object for runqemu |
| 40 | self.runqemu = None | 39 | self.runqemu = None |
| @@ -69,7 +68,6 @@ class QemuRunner: | |||
| 69 | if not workdir: | 68 | if not workdir: |
| 70 | workdir = os.getcwd() | 69 | workdir = os.getcwd() |
| 71 | self.qemu_pidfile = workdir + '/pidfile_' + str(os.getpid()) | 70 | self.qemu_pidfile = workdir + '/pidfile_' + str(os.getpid()) |
| 72 | self.host_dumper = HostDumper(dump_host_cmds, dump_dir) | ||
| 73 | self.monitorpipe = None | 71 | self.monitorpipe = None |
| 74 | 72 | ||
| 75 | self.logger = logger | 73 | self.logger = logger |
| @@ -138,7 +136,6 @@ class QemuRunner: | |||
| 138 | self.logger.error('runqemu exited with code %d' % self.runqemu.returncode) | 136 | self.logger.error('runqemu exited with code %d' % self.runqemu.returncode) |
| 139 | self.logger.error('Output from runqemu:\n%s' % self.getOutput(self.runqemu.stdout)) | 137 | self.logger.error('Output from runqemu:\n%s' % self.getOutput(self.runqemu.stdout)) |
| 140 | self.stop() | 138 | self.stop() |
| 141 | self._dump_host() | ||
| 142 | 139 | ||
| 143 | def start(self, qemuparams = None, get_ip = True, extra_bootparams = None, runqemuparams='', launch_cmd=None, discard_writes=True): | 140 | def start(self, qemuparams = None, get_ip = True, extra_bootparams = None, runqemuparams='', launch_cmd=None, discard_writes=True): |
| 144 | env = os.environ.copy() | 141 | env = os.environ.copy() |
| @@ -286,7 +283,6 @@ class QemuRunner: | |||
| 286 | if self.runqemu.returncode: | 283 | if self.runqemu.returncode: |
| 287 | # No point waiting any longer | 284 | # No point waiting any longer |
| 288 | self.logger.warning('runqemu exited with code %d' % self.runqemu.returncode) | 285 | self.logger.warning('runqemu exited with code %d' % self.runqemu.returncode) |
| 289 | self._dump_host() | ||
| 290 | self.logger.warning("Output from runqemu:\n%s" % self.getOutput(output)) | 286 | self.logger.warning("Output from runqemu:\n%s" % self.getOutput(output)) |
| 291 | self.stop() | 287 | self.stop() |
| 292 | return False | 288 | return False |
| @@ -314,7 +310,6 @@ class QemuRunner: | |||
| 314 | ps = subprocess.Popen(['ps', 'axww', '-o', 'pid,ppid,pri,ni,command '], stdout=subprocess.PIPE).communicate()[0] | 310 | ps = subprocess.Popen(['ps', 'axww', '-o', 'pid,ppid,pri,ni,command '], stdout=subprocess.PIPE).communicate()[0] |
| 315 | processes = ps.decode("utf-8") | 311 | processes = ps.decode("utf-8") |
| 316 | self.logger.debug("Running processes:\n%s" % processes) | 312 | self.logger.debug("Running processes:\n%s" % processes) |
| 317 | self._dump_host() | ||
| 318 | op = self.getOutput(output) | 313 | op = self.getOutput(output) |
| 319 | self.stop() | 314 | self.stop() |
| 320 | if op: | 315 | if op: |
| @@ -430,7 +425,6 @@ class QemuRunner: | |||
| 430 | self.logger.error("Couldn't get ip from qemu command line and runqemu output! " | 425 | self.logger.error("Couldn't get ip from qemu command line and runqemu output! " |
| 431 | "Here is the qemu command line used:\n%s\n" | 426 | "Here is the qemu command line used:\n%s\n" |
| 432 | "and output from runqemu:\n%s" % (cmdline, out)) | 427 | "and output from runqemu:\n%s" % (cmdline, out)) |
| 433 | self._dump_host() | ||
| 434 | self.stop() | 428 | self.stop() |
| 435 | return False | 429 | return False |
| 436 | 430 | ||
| @@ -517,7 +511,6 @@ class QemuRunner: | |||
| 517 | lines = tail(bootlog if bootlog else self.msg) | 511 | lines = tail(bootlog if bootlog else self.msg) |
| 518 | self.logger.warning("Last 25 lines of text (%d):\n%s" % (len(bootlog), lines)) | 512 | self.logger.warning("Last 25 lines of text (%d):\n%s" % (len(bootlog), lines)) |
| 519 | self.logger.warning("Check full boot log: %s" % self.logfile) | 513 | self.logger.warning("Check full boot log: %s" % self.logfile) |
| 520 | self._dump_host() | ||
| 521 | self.stop() | 514 | self.stop() |
| 522 | return False | 515 | return False |
| 523 | 516 | ||
| @@ -698,13 +691,6 @@ class QemuRunner: | |||
| 698 | status = 1 | 691 | status = 1 |
| 699 | return (status, str(data)) | 692 | return (status, str(data)) |
| 700 | 693 | ||
| 701 | |||
| 702 | def _dump_host(self): | ||
| 703 | self.host_dumper.create_dir("qemu") | ||
| 704 | self.logger.warning("Qemu ended unexpectedly, dump data from host" | ||
| 705 | " is in %s" % self.host_dumper.dump_dir) | ||
| 706 | self.host_dumper.dump_host() | ||
| 707 | |||
| 708 | # This class is for reading data from a socket and passing it to logfunc | 694 | # This class is for reading data from a socket and passing it to logfunc |
| 709 | # to be processed. It's completely event driven and has a straightforward | 695 | # to be processed. It's completely event driven and has a straightforward |
| 710 | # event loop. The mechanism for stopping the thread is a simple pipe which | 696 | # event loop. The mechanism for stopping the thread is a simple pipe which |
