qemu-block
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v3 01/15] python: qemu: add timer parameter for qmp.accept so


From: John Snow
Subject: Re: [PATCH v3 01/15] python: qemu: add timer parameter for qmp.accept socket
Date: Thu, 13 May 2021 13:54:22 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1

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 <jsnow@redhat.com>


Signed-off-by: Emanuele Giuseppe Esposito <eesposit@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:
          """





reply via email to

[Prev in Thread] Current Thread [Next in Thread]