qemu-block
[Top][All Lists]
Advanced

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

Re: [PATCH v3 4/4] python/aqmp: add socket bind step to legacy.py


From: Hanna Reitz
Subject: Re: [PATCH v3 4/4] python/aqmp: add socket bind step to legacy.py
Date: Thu, 27 Jan 2022 16:50:14 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0

On 24.01.22 19:06, John Snow wrote:
The synchronous QMP library would bind to the server address during
__init__(). The new library delays this to the accept() call, because
binding occurs inside of the call to start_[unix_]server(), which is an
async method -- so it cannot happen during __init__ anymore.

Python 3.7+ adds the ability to create the server (and thus the bind()
call) and begin the active listening in separate steps, but we don't
have that functionality in 3.6, our current minimum.

Therefore ... Add a temporary workaround that allows the synchronous
version of the client to bind the socket in advance, guaranteeing that
there will be a UNIX socket in the filesystem ready for the QEMU client
to connect to without a race condition.

(Yes, it's a bit ugly. Fixing it more nicely will have to wait until our
minimum Python version is 3.7+.)

I mean.  Looks good to me?  Not quite enough for an R-b, I’d say, and you don’t really need an A-b from me on this, but looks good to me! O:)

Signed-off-by: John Snow <jsnow@redhat.com>
---
  python/qemu/aqmp/legacy.py   |  3 +++
  python/qemu/aqmp/protocol.py | 41 +++++++++++++++++++++++++++++++++---
  2 files changed, 41 insertions(+), 3 deletions(-)




reply via email to

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