summary refs log tree commit diff stats
path: root/python/qemu/aqmp/legacy.py
diff options
context:
space:
mode:
authorJohn Snow <jsnow@redhat.com>2022-02-25 15:59:39 -0500
committerJohn Snow <jsnow@redhat.com>2022-03-07 14:36:41 -0500
commit40196c23939758abc5300e85333e676196e3ba6d (patch)
treebe0c62a938ac3e9750fea7dd356c433adf5c95c3 /python/qemu/aqmp/legacy.py
parentb49872aa8fc0f3f5a3036cc37aa2cb5c92866f33 (diff)
downloadfocaccia-qemu-40196c23939758abc5300e85333e676196e3ba6d.tar.gz
focaccia-qemu-40196c23939758abc5300e85333e676196e3ba6d.zip
python/aqmp: add _session_guard()
In _new_session, there's a fairly complex except clause that's used to
give semantic errors to callers of accept() and connect(). We need to
create a new two-step replacement for accept(), so factoring out this
piece of logic will be useful.

Bolster the comments and docstring here to try and demystify what's
going on in this fairly delicate piece of Python magic.

(If we were using Python 3.7+, this would be an @asynccontextmanager. We
don't have that very nice piece of magic, however, so this must take an
Awaitable to manage the Exception contexts properly. We pay the price
for platform compatibility.)

Signed-off-by: John Snow <jsnow@redhat.com>
Acked-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Message-id: 20220225205948.3693480-2-jsnow@redhat.com
Signed-off-by: John Snow <jsnow@redhat.com>
Diffstat (limited to 'python/qemu/aqmp/legacy.py')
0 files changed, 0 insertions, 0 deletions