Skip to content

Commit 2ad7624

Browse files
committed
Merge remote-tracking branch 'remotes/jsnow-gitlab/tags/python-pull-request' into staging
Python patches Hopefully, fixes the race conditions witnessed through the NetBSD vm tests. # gpg: Signature made Mon 07 Mar 2022 22:14:42 GMT # gpg: using RSA key F9B7ABDBBCACDF95BE76CBD07DEF8106AAFC390E # gpg: Good signature from "John Snow (John Huston) <jsnow@redhat.com>" [full] # Primary key fingerprint: FAEB 9711 A12C F475 812F 18F2 88A9 064D 1835 61EB # Subkey fingerprint: F9B7 ABDB BCAC DF95 BE76 CBD0 7DEF 8106 AAFC 390E * remotes/jsnow-gitlab/tags/python-pull-request: scripts/qmp-shell-wrap: Fix import path python/aqmp: drop _bind_hack() python/aqmp: fix race condition in legacy.py python/aqmp: add start_server() and accept() methods python/aqmp: stop the server during disconnect() python/aqmp: refactor _do_accept() into two distinct steps python/aqmp: squelch pylint warning for too many lines python/aqmp: split _client_connected_cb() out as _incoming() python/aqmp: remove _new_session and _establish_connection python/aqmp: rename 'accept()' to 'start_server_and_accept()' python/aqmp: add _session_guard() Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2 parents 9a61e6c + 7cba010 commit 2ad7624

File tree

4 files changed

+268
-167
lines changed

4 files changed

+268
-167
lines changed

python/qemu/aqmp/legacy.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def __init__(self, address: SocketAddrT,
5757
self._timeout: Optional[float] = None
5858

5959
if server:
60-
self._aqmp._bind_hack(address) # pylint: disable=protected-access
60+
self._sync(self._aqmp.start_server(self._address))
6161

6262
_T = TypeVar('_T')
6363

@@ -90,10 +90,7 @@ def accept(self, timeout: Optional[float] = 15.0) -> QMPMessage:
9090
self._aqmp.await_greeting = True
9191
self._aqmp.negotiate = True
9292

93-
self._sync(
94-
self._aqmp.accept(self._address),
95-
timeout
96-
)
93+
self._sync(self._aqmp.accept(), timeout)
9794

9895
ret = self._get_greeting()
9996
assert ret is not None

0 commit comments

Comments
 (0)