[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 1/3] tests/avocado: reverse_debugging drain console to prevent ha
From: |
Nicholas Piggin |
Subject: |
[PATCH 1/3] tests/avocado: reverse_debugging drain console to prevent hang |
Date: |
Thu, 16 Nov 2023 21:53:52 +1000 |
Like replay_linux.py, reverse_debugging.py starts the vm with console
set but does not interact with it (e.g., with wait_for_console_pattern).
In this situation, the console should have a drainer attached so the
socket does not fill. replay_linux.py has a drainer, but it is missing
from reverse_debugging.py.
Per analysis in Link: this can cause the console socket/pipe to fill and
QEMU get stuck in qemu_chr_write_buffer, leading to strange test case
failures (ppc64 fails because it prints a lot to console in early bios).
Attaching a drainer prevents this.
Note, this commit does not fix bugs introduced by the commits referenced
in the first two Fixes: tags, but together those commits conspire to
irritate the problem and cause test case failure, which this commit
fixes.
Link: ZVT-bY9YOr69QTPX@redhat.com/">https://lore.kernel.org/qemu-devel/ZVT-bY9YOr69QTPX@redhat.com/
Fixes: 1d4796cd0083 ("python/machine: use socketpair() for console connections")
Fixes: 761a13b23946 ("tests/avocado: ppc64 reverse debugging tests for pseries
and powernv")
Fixes: be52eca30978 ("tests/acceptance: add reverse debugging test")
Tested-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
---
tests/avocado/reverse_debugging.py | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/tests/avocado/reverse_debugging.py
b/tests/avocado/reverse_debugging.py
index fc47874eda..128d85bc0e 100644
--- a/tests/avocado/reverse_debugging.py
+++ b/tests/avocado/reverse_debugging.py
@@ -12,6 +12,7 @@
from avocado import skipIf
from avocado_qemu import BUILD_DIR
+from avocado.utils import datadrainer
from avocado.utils import gdb
from avocado.utils import process
from avocado.utils.network.ports import find_free_port
@@ -52,6 +53,10 @@ def run_vm(self, record, shift, args, replay_path,
image_path, port):
if args:
vm.add_args(*args)
vm.launch()
+ console_drainer = datadrainer.LineLogger(vm.console_socket.fileno(),
+ logger=self.log.getChild('console'),
+ stop_check=(lambda : not vm.is_running()))
+ console_drainer.start()
return vm
@staticmethod
--
2.42.0
- [PATCH 1/3] tests/avocado: reverse_debugging drain console to prevent hang,
Nicholas Piggin <=
- [PATCH 2/3] chardev: report blocked write to chardev backend, Nicholas Piggin, 2023/11/16
- Re: [PATCH 2/3] chardev: report blocked write to chardev backend, Marc-André Lureau, 2023/11/20
- Re: [PATCH 2/3] chardev: report blocked write to chardev backend, Nicholas Piggin, 2023/11/20
- Re: [PATCH 2/3] chardev: report blocked write to chardev backend, Marc-André Lureau, 2023/11/21
- Re: [PATCH 2/3] chardev: report blocked write to chardev backend, Daniel P . Berrangé, 2023/11/21
- Re: [PATCH 2/3] chardev: report blocked write to chardev backend, Thomas Huth, 2023/11/21
- Re: [PATCH 2/3] chardev: report blocked write to chardev backend, Marc-André Lureau, 2023/11/21
- Re: [PATCH 2/3] chardev: report blocked write to chardev backend, Alex Bennée, 2023/11/22
- Re: [PATCH 2/3] chardev: report blocked write to chardev backend, Thomas Huth, 2023/11/22
- Re: [PATCH 2/3] chardev: report blocked write to chardev backend, Daniel P . Berrangé, 2023/11/22