Skip to content

Commit 2012453

Browse files
jnsnowphilmd
authored andcommitted
iotests.py: use qemu.qmp type aliases
iotests.py should use the type definitions from qmp.py instead of its own. Signed-off-by: John Snow <[email protected]> Reviewed-by: Kevin Wolf <[email protected]> Message-Id: <[email protected]> Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
1 parent a5d7637 commit 2012453

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

tests/qemu-iotests/iotests.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,10 @@
3535
# pylint: disable=import-error, wrong-import-position
3636
sys.path.append(os.path.join(os.path.dirname(__file__), '..', '..', 'python'))
3737
from qemu import qtest
38+
from qemu.qmp import QMPMessage
3839

3940
assert sys.version_info >= (3, 6)
4041

41-
# Type Aliases
42-
QMPResponse = Dict[str, Any]
43-
44-
4542
# Use this logger for logging messages directly from the iotests module
4643
logger = logging.getLogger('qemu.iotests')
4744
logger.addHandler(logging.NullHandler())
@@ -561,7 +558,7 @@ def add_incoming(self, addr):
561558
self._args.append(addr)
562559
return self
563560

564-
def hmp(self, command_line: str, use_log: bool = False) -> QMPResponse:
561+
def hmp(self, command_line: str, use_log: bool = False) -> QMPMessage:
565562
cmd = 'human-monitor-command'
566563
kwargs = {'command-line': command_line}
567564
if use_log:
@@ -582,7 +579,7 @@ def resume_drive(self, drive: str) -> None:
582579
self.hmp(f'qemu-io {drive} "remove_break bp_{drive}"')
583580

584581
def hmp_qemu_io(self, drive: str, cmd: str,
585-
use_log: bool = False) -> QMPResponse:
582+
use_log: bool = False) -> QMPMessage:
586583
"""Write to a given drive using an HMP command"""
587584
return self.hmp(f'qemu-io {drive} "{cmd}"', use_log=use_log)
588585

0 commit comments

Comments
 (0)