summaryrefslogtreecommitdiffstats
path: root/python/qemu/qmp
diff options
context:
space:
mode:
authorJohn Snow2022-03-30 19:28:05 +0200
committerJohn Snow2022-04-21 17:01:00 +0200
commit9fcd3930e0b2f4f7c224d0e76d209ff1b5118abc (patch)
tree22e222a12e189fd4e8efec7cdd680ba066d937a4 /python/qemu/qmp
parentpython: temporarily silence pylint duplicate-code warnings (diff)
downloadqemu-9fcd3930e0b2f4f7c224d0e76d209ff1b5118abc.tar.gz
qemu-9fcd3930e0b2f4f7c224d0e76d209ff1b5118abc.tar.xz
qemu-9fcd3930e0b2f4f7c224d0e76d209ff1b5118abc.zip
python/aqmp: take QMPBadPortError and parse_address from qemu.qmp
Shift these definitions over from the qmp package to the async qmp package. (Licensing: this is a lateral move, from GPLv2 (only) to GPLv2 (only)) Signed-off-by: John Snow <jsnow@redhat.com> Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Reviewed-by: Beraldo Leal <bleal@redhat.com> Message-id: 20220330172812.3427355-3-jsnow@redhat.com Signed-off-by: John Snow <jsnow@redhat.com>
Diffstat (limited to 'python/qemu/qmp')
-rw-r--r--python/qemu/qmp/__init__.py26
1 files changed, 0 insertions, 26 deletions
diff --git a/python/qemu/qmp/__init__.py b/python/qemu/qmp/__init__.py
index 358c0971d0..4e08641154 100644
--- a/python/qemu/qmp/__init__.py
+++ b/python/qemu/qmp/__init__.py
@@ -102,12 +102,6 @@ class QMPResponseError(QMPError):
self.reply = reply
-class QMPBadPortError(QMPError):
- """
- Unable to parse socket address: Port was non-numerical.
- """
-
-
class QEMUMonitorProtocol:
"""
Provide an API to connect to QEMU via QEMU Monitor Protocol (QMP) and then
@@ -237,26 +231,6 @@ class QEMUMonitorProtocol:
# Implement context manager exit function.
self.close()
- @classmethod
- def parse_address(cls, address: str) -> SocketAddrT:
- """
- Parse a string into a QMP address.
-
- Figure out if the argument is in the port:host form.
- If it's not, it's probably a file path.
- """
- components = address.split(':')
- if len(components) == 2:
- try:
- port = int(components[1])
- except ValueError:
- msg = f"Bad port: '{components[1]}' in '{address}'."
- raise QMPBadPortError(msg) from None
- return (components[0], port)
-
- # Treat as filepath.
- return address
-
def connect(self, negotiate: bool = True) -> Optional[QMPMessage]:
"""
Connect to the QMP Monitor and perform capabilities negotiation.