python/qmp: Fix type of SocketAddrT
authorJohn Snow <jsnow@redhat.com>
Thu, 3 Jun 2021 00:37:02 +0000 (20:37 -0400)
committerJohn Snow <jsnow@redhat.com>
Fri, 18 Jun 2021 20:10:06 +0000 (16:10 -0400)
In porting the qom tools, qmp-shell, etc; it becomes evident that this
type is wrong.

This is an integer, not a string. We didn't catch this before because
none of QEMUMonitorProtocol's *users* happen to be checked, and the
internal logic of this class is otherwise self-consistent. Additionally,
mypy was not introspecting into the socket() interface to realize we
were passing a bad type for AF_INET. Fixed now.

Signed-off-by: John Snow <jsnow@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-id: 20210603003719.1321369-3-jsnow@redhat.com
Signed-off-by: John Snow <jsnow@redhat.com>
python/qemu/qmp/__init__.py

index 9606248a3d2ebe6cd5de397ab7c7a0908f8e2ff3..5fb970f8a802e0e63c9c8f80314708a238c735ae 100644 (file)
@@ -44,7 +44,7 @@ from typing import (
 QMPMessage = Dict[str, Any]
 QMPReturnValue = Dict[str, Any]
 
-InternetAddrT = Tuple[str, str]
+InternetAddrT = Tuple[str, int]
 UnixAddrT = str
 SocketAddrT = Union[InternetAddrT, UnixAddrT]