[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 05/15] qemu-iotests: delay QMP socket timers
From: |
Emanuele Giuseppe Esposito |
Subject: |
[PATCH v3 05/15] qemu-iotests: delay QMP socket timers |
Date: |
Wed, 14 Apr 2021 19:03:42 +0200 |
Attaching a gdbserver implies that the qmp socket
should wait indefinitely for an answer from QEMU.
Signed-off-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
---
python/qemu/machine.py | 3 +++
tests/qemu-iotests/iotests.py | 10 +++++++++-
2 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/python/qemu/machine.py b/python/qemu/machine.py
index 12752142c9..d6142271c2 100644
--- a/python/qemu/machine.py
+++ b/python/qemu/machine.py
@@ -409,6 +409,9 @@ def _launch(self) -> None:
stderr=subprocess.STDOUT,
shell=False,
close_fds=False)
+
+ if 'gdbserver' in self._wrapper:
+ self._qmp_timer = None
self._post_launch()
def _early_cleanup(self) -> None:
diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py
index 05d0dc0751..380527245e 100644
--- a/tests/qemu-iotests/iotests.py
+++ b/tests/qemu-iotests/iotests.py
@@ -478,7 +478,10 @@ def log(msg: Msg,
class Timeout:
def __init__(self, seconds, errmsg="Timeout"):
- self.seconds = seconds
+ if qemu_gdb:
+ self.seconds = 3000
+ else:
+ self.seconds = seconds
self.errmsg = errmsg
def __enter__(self):
signal.signal(signal.SIGALRM, self.timeout)
@@ -684,6 +687,11 @@ def qmp_to_opts(self, obj):
output_list += [key + '=' + obj[key]]
return ','.join(output_list)
+ def get_qmp_events(self, wait: bool = False) -> List[QMPMessage]:
+ if qemu_gdb:
+ wait = 0.0
+ return super().get_qmp_events(wait=wait)
+
def get_qmp_events_filtered(self, wait=60.0):
result = []
for ev in self.get_qmp_events(wait=wait):
--
2.30.2
- Re: [PATCH v3 01/15] python: qemu: add timer parameter for qmp.accept socket, (continued)
- [PATCH v3 02/15] python: qemu: pass the wrapper field from QEMUQtestmachine to QEMUMachine, Emanuele Giuseppe Esposito, 2021/04/14
- [PATCH v3 03/15] docs/devel/testing: add debug section to the QEMU iotests chapter, Emanuele Giuseppe Esposito, 2021/04/14
- [PATCH v3 04/15] qemu-iotests: add option to attach gdbserver, Emanuele Giuseppe Esposito, 2021/04/14
- [PATCH v3 05/15] qemu-iotests: delay QMP socket timers,
Emanuele Giuseppe Esposito <=
- [PATCH v3 06/15] qemu_iotests: insert gdbserver command line as wrapper for qemu binary, Emanuele Giuseppe Esposito, 2021/04/14
- [PATCH v3 07/15] qemu-iotests: add gdbserver option to script tests too, Emanuele Giuseppe Esposito, 2021/04/14
- [PATCH v3 08/15] docs/devel/testing: add -gdb option to the debugging section of QEMU iotests, Emanuele Giuseppe Esposito, 2021/04/14
- [PATCH v3 09/15] qemu_iotests: extend the check script to support valgrind for python tests, Emanuele Giuseppe Esposito, 2021/04/14