On 4/14/21 1:03 PM, Emanuele Giuseppe Esposito wrote:
Add a new _qmp_timer field to the QEMUMachine class.
The default timer is 15 sec, as per the default in the
qmp accept() function.
Fine enough for now.
What's the exact need for this change, exactly? Is it just to prevent
any unbounded blocking waits? I assume this came up in development or
you'd not have added it.
Reviewed-by: John Snow <js...@redhat.com>
Signed-off-by: Emanuele Giuseppe Esposito <eespo...@redhat.com>
---
python/qemu/machine.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/python/qemu/machine.py b/python/qemu/machine.py
index 6e44bda337..12752142c9 100644
--- a/python/qemu/machine.py
+++ b/python/qemu/machine.py
@@ -110,6 +110,7 @@ def __init__(self,
self._binary = binary
self._args = list(args)
self._wrapper = wrapper
+ self._qmp_timer = 15.0
self._name = name or "qemu-%d" % os.getpid()
self._test_dir = test_dir
@@ -323,7 +324,7 @@ def _pre_launch(self) -> None:
def _post_launch(self) -> None:
if self._qmp_connection:
- self._qmp.accept()
+ self._qmp.accept(self._qmp_timer)
def _post_shutdown(self) -> None:
"""