mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-11 03:24:58 -06:00
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 <jsnow@redhat.com> Reviewed-by: Kevin Wolf <kwolf@redhat.com> Message-Id: <20200710052220.3306-3-jsnow@redhat.com> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
This commit is contained in:
parent
a5d76376d6
commit
2012453ddd
1 changed files with 3 additions and 6 deletions
|
@ -35,13 +35,10 @@ import unittest
|
||||||
# pylint: disable=import-error, wrong-import-position
|
# pylint: disable=import-error, wrong-import-position
|
||||||
sys.path.append(os.path.join(os.path.dirname(__file__), '..', '..', 'python'))
|
sys.path.append(os.path.join(os.path.dirname(__file__), '..', '..', 'python'))
|
||||||
from qemu import qtest
|
from qemu import qtest
|
||||||
|
from qemu.qmp import QMPMessage
|
||||||
|
|
||||||
assert sys.version_info >= (3, 6)
|
assert sys.version_info >= (3, 6)
|
||||||
|
|
||||||
# Type Aliases
|
|
||||||
QMPResponse = Dict[str, Any]
|
|
||||||
|
|
||||||
|
|
||||||
# Use this logger for logging messages directly from the iotests module
|
# Use this logger for logging messages directly from the iotests module
|
||||||
logger = logging.getLogger('qemu.iotests')
|
logger = logging.getLogger('qemu.iotests')
|
||||||
logger.addHandler(logging.NullHandler())
|
logger.addHandler(logging.NullHandler())
|
||||||
|
@ -561,7 +558,7 @@ class VM(qtest.QEMUQtestMachine):
|
||||||
self._args.append(addr)
|
self._args.append(addr)
|
||||||
return self
|
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'
|
cmd = 'human-monitor-command'
|
||||||
kwargs = {'command-line': command_line}
|
kwargs = {'command-line': command_line}
|
||||||
if use_log:
|
if use_log:
|
||||||
|
@ -582,7 +579,7 @@ class VM(qtest.QEMUQtestMachine):
|
||||||
self.hmp(f'qemu-io {drive} "remove_break bp_{drive}"')
|
self.hmp(f'qemu-io {drive} "remove_break bp_{drive}"')
|
||||||
|
|
||||||
def hmp_qemu_io(self, drive: str, cmd: str,
|
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"""
|
"""Write to a given drive using an HMP command"""
|
||||||
return self.hmp(f'qemu-io {drive} "{cmd}"', use_log=use_log)
|
return self.hmp(f'qemu-io {drive} "{cmd}"', use_log=use_log)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue