From: Vladimir Sementsov-Ogievskiy Date: Fri, 6 Oct 2023 15:41:17 +0000 (+0300) Subject: iotests: QemuStorageDaemon: add cmd() method like in QEMUMachine. X-Git-Tag: v8.2.0-rc0~68^2~8 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3a8736cf1e069c2b93c194d71062f911ff2571e7;p=thirdparty%2Fqemu.git iotests: QemuStorageDaemon: add cmd() method like in QEMUMachine. Add similar method for consistency. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Eric Blake Message-id: 20231006154125.1068348-8-vsementsov@yandex-team.ru Signed-off-by: John Snow --- diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py index 0c061d89867..ee7b6ddeffd 100644 --- a/tests/qemu-iotests/iotests.py +++ b/tests/qemu-iotests/iotests.py @@ -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()