iotests: QemuStorageDaemon: add cmd() method like in QEMUMachine.

Add similar method for consistency.

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-id: 20231006154125.1068348-8-vsementsov@yandex-team.ru
Signed-off-by: John Snow <jsnow@redhat.com>
This commit is contained in:
Vladimir Sementsov-Ogievskiy 2023-10-06 18:41:17 +03:00 committed by John Snow
parent 4e620ff48f
commit 3a8736cf1e
1 changed files with 6 additions and 1 deletions

View File

@ -38,7 +38,7 @@ import unittest
from contextlib import contextmanager
from qemu.machine import qtest
from qemu.qmp.legacy import QMPMessage, QEMUMonitorProtocol
from qemu.qmp.legacy import QMPMessage, QMPReturnValue, QEMUMonitorProtocol
from qemu.utils import VerboseProcessError
# Use this logger for logging messages directly from the iotests module
@ -466,6 +466,11 @@ class QemuStorageDaemon:
assert self._qmp is not None
return self._qmp
def cmd(self, cmd: str, args: Optional[Dict[str, object]] = None) \
-> QMPReturnValue:
assert self._qmp is not None
return self._qmp.cmd(cmd, **(args or {}))
def stop(self, kill_signal=15):
self._p.send_signal(kill_signal)
self._p.wait()