Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/client/virt/kvm_vm.py b/client/virt/kvm_vm.py
- index ffa55c1..a3aa45f 100644
- --- a/client/virt/kvm_vm.py
- +++ b/client/virt/kvm_vm.py
- @@ -10,6 +10,25 @@ from autotest_lib.client.bin import utils
- import virt_utils, virt_vm, virt_test_setup, kvm_monitor, aexpect
- +class QemuSegFaultError(virt_vm.VMError):
- + def __init__(self, crash_message):
- + virt_vm.VMError.__init__(self, crash_message)
- + self.crash_message = crash_message
- +
- + def __str__(self):
- + return ("Qemu crashed: %s" % self.crash_message)
- +
- +
- +def log_qemu_output(line):
- + """
- + Verifies a line of output from qemu, if (core dumped) is found,
- + raise a QemuSegFaultError.
- + """
- + logging.info(line)
- + if "(core dumped)" in line:
- + raise QemuSegFaultError(line)
- +
- +
- class VM(virt_vm.BaseVM):
- """
- This class handles all basic VM operations.
- @@ -786,7 +805,7 @@ class VM(virt_vm.BaseVM):
- logging.info("Running qemu command:\n%s", qemu_command)
- self.process = aexpect.run_bg(qemu_command, None,
- - logging.info, "[qemu output] ")
- + log_qemu_output, "[qemu output] ")
- for tapfd in self.tapfds:
- try:
- os.close(tapfd)
Add Comment
Please, Sign In to add comment