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

[qemu-xen staging] python/qmp.py: Define common types



commit a5d76376d65d8777f28bb064412a8d72fa2c7953
Author:     John Snow <jsnow@xxxxxxxxxx>
AuthorDate: Fri Jul 10 01:22:05 2020 -0400
Commit:     Philippe Mathieu-Daudé <philmd@xxxxxxxxxx>
CommitDate: Tue Jul 14 22:22:22 2020 +0200

    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@xxxxxxxxxx>
    Reviewed-by: Kevin Wolf <kwolf@xxxxxxxxxx>
    Message-Id: <20200710052220.3306-2-jsnow@xxxxxxxxxx>
    Signed-off-by: Philippe Mathieu-Daudé <philmd@xxxxxxxxxx>
---
 python/qemu/qmp.py | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/python/qemu/qmp.py b/python/qemu/qmp.py
index e64b6b5faa..8388c7b603 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
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.