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: Emanuele Giuseppe Esposito
Subject: Re: [PATCH v3 01/15] python: qemu: add timer parameter for qmp.accept socket
Date: Fri, 14 May 2021 10:16:22 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1



On 13/05/2021 19:54, John Snow wrote:
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.

The default was already 15 sec, but since we now want to make the wait unbounded if we use gdbserver or valgrind and we do it by always passing the _qmp_timer to the .accept function, we need to set a default value.
Yes, it came up while testing with gdb.


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]