[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 02/16] iotests.py: use qemu.qmp type aliases
From: |
John Snow |
Subject: |
[PATCH v2 02/16] iotests.py: use qemu.qmp type aliases |
Date: |
Tue, 2 Jun 2020 17:45:14 -0400 |
iotests.py should use the type definitions from qmp.py instead of its
own.
Signed-off-by: John Snow <jsnow@redhat.com>
---
tests/qemu-iotests/iotests.py | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py
index f20d90f9698..7c1773bba37 100644
--- a/tests/qemu-iotests/iotests.py
+++ b/tests/qemu-iotests/iotests.py
@@ -35,13 +35,10 @@
# pylint: disable=import-error, wrong-import-position
sys.path.append(os.path.join(os.path.dirname(__file__), '..', '..', 'python'))
from qemu import qtest
+from qemu.qmp import QMPMessage
assert sys.version_info >= (3, 6)
-# Type Aliases
-QMPResponse = Dict[str, Any]
-
-
# Use this logger for logging messages directly from the iotests module
logger = logging.getLogger('qemu.iotests')
logger.addHandler(logging.NullHandler())
@@ -554,7 +551,7 @@ def add_incoming(self, addr):
self._args.append(addr)
return self
- def hmp(self, command_line: str, use_log: bool = False) -> QMPResponse:
+ def hmp(self, command_line: str, use_log: bool = False) -> QMPMessage:
cmd = 'human-monitor-command'
kwargs = {'command-line': command_line}
if use_log:
@@ -575,7 +572,7 @@ def resume_drive(self, drive: str) -> None:
self.hmp(f'qemu-io {drive} "remove_break bp_{drive}"')
def hmp_qemu_io(self, drive: str, cmd: str,
- use_log: bool = False) -> QMPResponse:
+ use_log: bool = False) -> QMPMessage:
"""Write to a given drive using an HMP command"""
return self.hmp(f'qemu-io {drive} "{cmd}"', use_log=use_log)
--
2.21.3
- [PATCH v2 00/16] python: add mypy support to python/qemu, John Snow, 2020/06/02
- [PATCH v2 02/16] iotests.py: use qemu.qmp type aliases,
John Snow <=
- [PATCH v2 01/16] python/qmp.py: Define common types, John Snow, 2020/06/02
- [PATCH v2 03/16] python/qmp.py: re-absorb MonitorResponseError, John Snow, 2020/06/02
- [PATCH v2 04/16] python/qmp.py: Do not return None from cmd_obj, John Snow, 2020/06/02
- [PATCH v2 05/16] python/qmp.py: add casts to JSON deserialization, John Snow, 2020/06/02
- [PATCH v2 06/16] python/qmp.py: add QMPProtocolError, John Snow, 2020/06/02
- [PATCH v2 07/16] python/machine.py: Fix monitor address typing, John Snow, 2020/06/02
- [PATCH v2 09/16] python/machine.py: Don't modify state in _base_args(), John Snow, 2020/06/02
- [PATCH v2 08/16] python/machine.py: reorder __init__, John Snow, 2020/06/02