summary refs log tree commit diff stats
path: root/python/qemu/qmp
diff options
context:
space:
mode:
authorVladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>2023-10-06 18:41:15 +0300
committerJohn Snow <jsnow@redhat.com>2023-10-12 14:21:43 -0400
commit684750ab4f8a3ad69512b71532408be3ac2547d4 (patch)
tree30f6b76726f7307b908c22db995653936e542b7a /python/qemu/qmp
parent37274707f6f3868fae7e0055d9a703006fc142d0 (diff)
downloadfocaccia-qemu-684750ab4f8a3ad69512b71532408be3ac2547d4.tar.gz
focaccia-qemu-684750ab4f8a3ad69512b71532408be3ac2547d4.zip
python/qemu: rename command() to cmd()
Use a shorter name. We are going to move in iotests from qmp() to
command() where possible. But command() is longer than qmp() and don't
look better. Let's rename.

You can simply grep for '\.command(' and for 'def command(' to check
that everything is updated (command() in tests/docker/docker.py is
unrelated).

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Cédric Le Goater <clg@kaod.org>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Message-id: 20231006154125.1068348-6-vsementsov@yandex-team.ru
[vsementsov: also update three occurrences in
   tests/avocado/machine_aspeed.py and keep r-b]
Signed-off-by: John Snow <jsnow@redhat.com>
Diffstat (limited to 'python/qemu/qmp')
-rw-r--r--python/qemu/qmp/legacy.py2
-rw-r--r--python/qemu/qmp/qmp_shell.py2
2 files changed, 2 insertions, 2 deletions
diff --git a/python/qemu/qmp/legacy.py b/python/qemu/qmp/legacy.py
index e5fa1ce9c4..22a2b5616e 100644
--- a/python/qemu/qmp/legacy.py
+++ b/python/qemu/qmp/legacy.py
@@ -207,7 +207,7 @@ class QEMUMonitorProtocol:
             qmp_cmd['arguments'] = args
         return self.cmd_obj(qmp_cmd)
 
-    def command(self, cmd: str, **kwds: object) -> QMPReturnValue:
+    def cmd(self, cmd: str, **kwds: object) -> QMPReturnValue:
         """
         Build and send a QMP command to the monitor, report errors if any
         """
diff --git a/python/qemu/qmp/qmp_shell.py b/python/qemu/qmp/qmp_shell.py
index 988d79c01b..98e684e9e8 100644
--- a/python/qemu/qmp/qmp_shell.py
+++ b/python/qemu/qmp/qmp_shell.py
@@ -202,7 +202,7 @@ class QMPShell(QEMUMonitorProtocol):
 
     def _fill_completion(self) -> None:
         try:
-            cmds = cast(List[Dict[str, str]], self.command('query-commands'))
+            cmds = cast(List[Dict[str, str]], self.cmd('query-commands'))
             for cmd in cmds:
                 self._completer.append(cmd['name'])
         except ExecuteError: