]> git.proxmox.com Git - mirror_qemu.git/commit
python/aqmp: add start_server() and accept() methods
authorJohn Snow <jsnow@redhat.com>
Fri, 25 Feb 2022 20:59:46 +0000 (15:59 -0500)
committerJohn Snow <jsnow@redhat.com>
Mon, 7 Mar 2022 19:36:41 +0000 (14:36 -0500)
commit481607c7d35de2bc4d9bec7f4734036fc467f330
treeb647655cb39d9e772675221bdf525906f6a49032
parent32c5abf051d06ff103d9d30eb6a7f3e8bf582334
python/aqmp: add start_server() and accept() methods

Add start_server() and accept() methods that can be used instead of
start_server_and_accept() to allow more fine-grained control over the
incoming connection process.

(Eagle-eyed reviewers will surely notice that it's a bit weird that
"CONNECTING" is a state that's shared between both the start_server()
and connect() states. That's absolutely true, and it's very true that
checking on the presence of _accepted as an indicator of state is a
hack. That's also very certainly true. But ... this keeps client code an
awful lot simpler, as it doesn't have to care exactly *how* the
connection is being made, just that it *is*. Is it worth disrupting that
simplicity in order to provide a better state guard on `accept()`? Hm.)

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-9-jsnow@redhat.com
Signed-off-by: John Snow <jsnow@redhat.com>
python/qemu/aqmp/protocol.py
python/tests/protocol.py