summary refs log tree commit diff stats
path: root/python/qemu/aqmp/__init__.py
diff options
context:
space:
mode:
authorJohn Snow <jsnow@redhat.com>2021-09-15 12:29:34 -0400
committerJohn Snow <jsnow@redhat.com>2021-09-27 12:10:29 -0400
commitc58b42e095aed868b5d08b9deab61436ab45b7cf (patch)
tree4e3869a534eace6c02314d43f70e53fb62edc047 /python/qemu/aqmp/__init__.py
parent4ccaab0377dec88b5cf1a55064b4953f6ab59d9f (diff)
downloadfocaccia-qemu-c58b42e095aed868b5d08b9deab61436ab45b7cf.tar.gz
focaccia-qemu-c58b42e095aed868b5d08b9deab61436ab45b7cf.zip
python/aqmp: add runstate state machine to AsyncProtocol
This serves a few purposes:

1. Protect interfaces when it's not safe to call them (via @require)

2. Add an interface by which an async client can determine if the state
has changed, for the purposes of connection management.

Signed-off-by: John Snow <jsnow@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-id: 20210915162955.333025-7-jsnow@redhat.com
Signed-off-by: John Snow <jsnow@redhat.com>
Diffstat (limited to 'python/qemu/aqmp/__init__.py')
-rw-r--r--python/qemu/aqmp/__init__.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/python/qemu/aqmp/__init__.py b/python/qemu/aqmp/__init__.py
index 5c0de72672..88ead4c023 100644
--- a/python/qemu/aqmp/__init__.py
+++ b/python/qemu/aqmp/__init__.py
@@ -22,12 +22,16 @@ managing QMP events.
 # the COPYING file in the top-level directory.
 
 from .error import AQMPError
-from .protocol import ConnectError
+from .protocol import ConnectError, Runstate, StateError
 
 
 # The order of these fields impact the Sphinx documentation order.
 __all__ = (
+    # Classes
+    'Runstate',
+
     # Exceptions, most generic to most explicit
     'AQMPError',
+    'StateError',
     'ConnectError',
 )