aboutsummaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorJohn Snow <jsnow@redhat.com>2020-07-10 01:22:05 -0400
committerPhilippe Mathieu-Daudé <philmd@redhat.com>2020-07-14 22:22:22 +0200
commita5d76376d65d8777f28bb064412a8d72fa2c7953 (patch)
treec1c44aa15fa9371dcda68d7995a53d6457b2d8b0 /python
parent04f0e36eba7b1a06e413a0690d4b1a24994d99fe (diff)
downloadqemu-a5d76376d65d8777f28bb064412a8d72fa2c7953.zip
qemu-a5d76376d65d8777f28bb064412a8d72fa2c7953.tar.gz
qemu-a5d76376d65d8777f28bb064412a8d72fa2c7953.tar.bz2
python/qmp.py: Define common types
Define some common types that we'll need to annotate a lot of other functions going forward. Signed-off-by: John Snow <jsnow@redhat.com> Reviewed-by: Kevin Wolf <kwolf@redhat.com> Message-Id: <20200710052220.3306-2-jsnow@redhat.com> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Diffstat (limited to 'python')
-rw-r--r--python/qemu/qmp.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/python/qemu/qmp.py b/python/qemu/qmp.py
index e64b6b5..8388c7b 100644
--- a/python/qemu/qmp.py
+++ b/python/qemu/qmp.py
@@ -12,13 +12,31 @@ import errno
import socket
import logging
from typing import (
+ Any,
+ Dict,
Optional,
TextIO,
Type,
+ Tuple,
+ Union,
)
from types import TracebackType
+# QMPMessage is a QMP Message of any kind.
+# e.g. {'yee': 'haw'}
+#
+# QMPReturnValue is the inner value of return values only.
+# {'return': {}} is the QMPMessage,
+# {} is the QMPReturnValue.
+QMPMessage = Dict[str, Any]
+QMPReturnValue = Dict[str, Any]
+
+InternetAddrT = Tuple[str, str]
+UnixAddrT = str
+SocketAddrT = Union[InternetAddrT, UnixAddrT]
+
+
class QMPError(Exception):
"""
QMP base exception