mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 08:13:54 -06:00
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>
This commit is contained in:
parent
37274707f6
commit
684750ab4f
29 changed files with 200 additions and 195 deletions
|
@ -69,7 +69,7 @@ sock = sys.argv[1]
|
|||
shell = QEMUMonitorProtocol(sock)
|
||||
shell.connect()
|
||||
|
||||
models = shell.command("query-cpu-definitions")
|
||||
models = shell.cmd("query-cpu-definitions")
|
||||
|
||||
# These QMP props don't correspond to CPUID fatures
|
||||
# so ignore them
|
||||
|
@ -93,9 +93,9 @@ for model in models:
|
|||
models = {}
|
||||
|
||||
for name in sorted(names):
|
||||
cpu = shell.command("query-cpu-model-expansion",
|
||||
{ "type": "static",
|
||||
"model": { "name": name }})
|
||||
cpu = shell.cmd("query-cpu-model-expansion",
|
||||
{ "type": "static",
|
||||
"model": { "name": name }})
|
||||
|
||||
got = {}
|
||||
for (feature, present) in cpu["model"]["props"].items():
|
||||
|
|
|
@ -269,14 +269,14 @@ def formatTestCase(t):
|
|||
|
||||
def qomListTypeNames(vm, **kwargs):
|
||||
"""Run qom-list-types QMP command, return type names"""
|
||||
types = vm.command('qom-list-types', **kwargs)
|
||||
types = vm.cmd('qom-list-types', **kwargs)
|
||||
return [t['name'] for t in types]
|
||||
|
||||
|
||||
def infoQDM(vm):
|
||||
"""Parse 'info qdm' output"""
|
||||
args = {'command-line': 'info qdm'}
|
||||
devhelp = vm.command('human-monitor-command', **args)
|
||||
devhelp = vm.cmd('human-monitor-command', **args)
|
||||
for l in devhelp.split('\n'):
|
||||
l = l.strip()
|
||||
if l == '' or l.endswith(':'):
|
||||
|
@ -304,9 +304,9 @@ class QemuBinaryInfo(object):
|
|||
# there's no way to query DeviceClass::user_creatable using QMP,
|
||||
# so use 'info qdm':
|
||||
self.no_user_devs = set([d['name'] for d in infoQDM(vm, ) if d['no-user']])
|
||||
self.machines = list(m['name'] for m in vm.command('query-machines'))
|
||||
self.machines = list(m['name'] for m in vm.cmd('query-machines'))
|
||||
self.user_devs = self.alldevs.difference(self.no_user_devs)
|
||||
self.kvm_available = vm.command('query-kvm')['enabled']
|
||||
self.kvm_available = vm.cmd('query-kvm')['enabled']
|
||||
finally:
|
||||
vm.shutdown()
|
||||
|
||||
|
|
|
@ -43,13 +43,13 @@ def render_block_graph(qmp, filename, format='png'):
|
|||
representation in @format into "@filename.@format"
|
||||
'''
|
||||
|
||||
bds_nodes = qmp.command('query-named-block-nodes')
|
||||
bds_nodes = qmp.cmd('query-named-block-nodes')
|
||||
bds_nodes = {n['node-name']: n for n in bds_nodes}
|
||||
|
||||
job_nodes = qmp.command('query-block-jobs')
|
||||
job_nodes = qmp.cmd('query-block-jobs')
|
||||
job_nodes = {n['device']: n for n in job_nodes}
|
||||
|
||||
block_graph = qmp.command('x-debug-query-block-graph')
|
||||
block_graph = qmp.cmd('x-debug-query-block-graph')
|
||||
|
||||
graph = Digraph(comment='Block Nodes Graph')
|
||||
graph.format = format
|
||||
|
@ -94,7 +94,7 @@ class LibvirtGuest():
|
|||
def __init__(self, name):
|
||||
self.name = name
|
||||
|
||||
def command(self, cmd):
|
||||
def cmd(self, cmd):
|
||||
# only supports qmp commands without parameters
|
||||
m = {'execute': cmd}
|
||||
ar = ['virsh', 'qemu-monitor-command', self.name, json.dumps(m)]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue