瀏覽代碼

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>
Vladimir Sementsov-Ogievskiy 1 年之前
父節點
當前提交
684750ab4f

+ 5 - 5
docs/devel/testing.rst

@@ -1014,8 +1014,8 @@ class.  Here's a simple usage example:
       """
       """
       def test_qmp_human_info_version(self):
       def test_qmp_human_info_version(self):
           self.vm.launch()
           self.vm.launch()
-          res = self.vm.command('human-monitor-command',
-                                command_line='info version')
+          res = self.vm.cmd('human-monitor-command',
+                            command_line='info version')
           self.assertRegexpMatches(res, r'^(\d+\.\d+\.\d)')
           self.assertRegexpMatches(res, r'^(\d+\.\d+\.\d)')
 
 
 To execute your test, run:
 To execute your test, run:
@@ -1065,15 +1065,15 @@ and hypothetical example follows:
           first_machine.launch()
           first_machine.launch()
           second_machine.launch()
           second_machine.launch()
 
 
-          first_res = first_machine.command(
+          first_res = first_machine.cmd(
               'human-monitor-command',
               'human-monitor-command',
               command_line='info version')
               command_line='info version')
 
 
-          second_res = second_machine.command(
+          second_res = second_machine.cmd(
               'human-monitor-command',
               'human-monitor-command',
               command_line='info version')
               command_line='info version')
 
 
-          third_res = self.get_vm(name='third_machine').command(
+          third_res = self.get_vm(name='third_machine').cmd(
               'human-monitor-command',
               'human-monitor-command',
               command_line='info version')
               command_line='info version')
 
 

+ 4 - 4
python/qemu/machine/machine.py

@@ -707,16 +707,16 @@ def qmp(self, cmd: str,
             self._quit_issued = True
             self._quit_issued = True
         return ret
         return ret
 
 
-    def command(self, cmd: str,
-                conv_keys: bool = True,
-                **args: Any) -> QMPReturnValue:
+    def cmd(self, cmd: str,
+            conv_keys: bool = True,
+            **args: Any) -> QMPReturnValue:
         """
         """
         Invoke a QMP command.
         Invoke a QMP command.
         On success return the response dict.
         On success return the response dict.
         On failure raise an exception.
         On failure raise an exception.
         """
         """
         qmp_args = self._qmp_args(conv_keys, args)
         qmp_args = self._qmp_args(conv_keys, args)
-        ret = self._qmp.command(cmd, **qmp_args)
+        ret = self._qmp.cmd(cmd, **qmp_args)
         if cmd == 'quit':
         if cmd == 'quit':
             self._quit_issued = True
             self._quit_issued = True
         return ret
         return ret

+ 1 - 1
python/qemu/qmp/legacy.py

@@ -207,7 +207,7 @@ def cmd_raw(self, name: str,
             qmp_cmd['arguments'] = args
             qmp_cmd['arguments'] = args
         return self.cmd_obj(qmp_cmd)
         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
         Build and send a QMP command to the monitor, report errors if any
         """
         """

+ 1 - 1
python/qemu/qmp/qmp_shell.py

@@ -202,7 +202,7 @@ def close(self) -> None:
 
 
     def _fill_completion(self) -> None:
     def _fill_completion(self) -> None:
         try:
         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:
             for cmd in cmds:
                 self._completer.append(cmd['name'])
                 self._completer.append(cmd['name'])
         except ExecuteError:
         except ExecuteError:

+ 1 - 1
python/qemu/utils/qemu_ga_client.py

@@ -64,7 +64,7 @@
 class QemuGuestAgent(QEMUMonitorProtocol):
 class QemuGuestAgent(QEMUMonitorProtocol):
     def __getattr__(self, name: str) -> Callable[..., Any]:
     def __getattr__(self, name: str) -> Callable[..., Any]:
         def wrapper(**kwds: object) -> object:
         def wrapper(**kwds: object) -> object:
-            return self.command('guest-' + name.replace('_', '-'), **kwds)
+            return self.cmd('guest-' + name.replace('_', '-'), **kwds)
         return wrapper
         return wrapper
 
 
 
 

+ 4 - 4
python/qemu/utils/qom.py

@@ -84,7 +84,7 @@ def __init__(self, args: argparse.Namespace):
         self.value = args.value
         self.value = args.value
 
 
     def run(self) -> int:
     def run(self) -> int:
-        rsp = self.qmp.command(
+        rsp = self.qmp.cmd(
             'qom-set',
             'qom-set',
             path=self.path,
             path=self.path,
             property=self.prop,
             property=self.prop,
@@ -129,7 +129,7 @@ def __init__(self, args: argparse.Namespace):
         self.prop = tmp[1]
         self.prop = tmp[1]
 
 
     def run(self) -> int:
     def run(self) -> int:
-        rsp = self.qmp.command(
+        rsp = self.qmp.cmd(
             'qom-get',
             'qom-get',
             path=self.path,
             path=self.path,
             property=self.prop
             property=self.prop
@@ -231,8 +231,8 @@ def _list_node(self, path: str) -> None:
             if item.child:
             if item.child:
                 continue
                 continue
             try:
             try:
-                rsp = self.qmp.command('qom-get', path=path,
-                                       property=item.name)
+                rsp = self.qmp.cmd('qom-get', path=path,
+                                   property=item.name)
                 print(f"  {item.name}: {rsp} ({item.type})")
                 print(f"  {item.name}: {rsp} ({item.type})")
             except ExecuteError as err:
             except ExecuteError as err:
                 print(f"  {item.name}: <EXCEPTION: {err!s}> ({item.type})")
                 print(f"  {item.name}: <EXCEPTION: {err!s}> ({item.type})")

+ 1 - 1
python/qemu/utils/qom_common.py

@@ -140,7 +140,7 @@ def qom_list(self, path: str) -> List[ObjectPropertyInfo]:
         """
         """
         :return: a strongly typed list from the 'qom-list' command.
         :return: a strongly typed list from the 'qom-list' command.
         """
         """
-        rsp = self.qmp.command('qom-list', path=path)
+        rsp = self.qmp.cmd('qom-list', path=path)
         # qom-list returns List[ObjectPropertyInfo]
         # qom-list returns List[ObjectPropertyInfo]
         assert isinstance(rsp, list)
         assert isinstance(rsp, list)
         return [ObjectPropertyInfo.make(x) for x in rsp]
         return [ObjectPropertyInfo.make(x) for x in rsp]

+ 3 - 3
python/qemu/utils/qom_fuse.py

@@ -137,7 +137,7 @@ def read(self, path: str, size: int, offset: int, fh: IO[bytes]) -> bytes:
         if path == '':
         if path == '':
             path = '/'
             path = '/'
         try:
         try:
-            data = str(self.qmp.command('qom-get', path=path, property=prop))
+            data = str(self.qmp.cmd('qom-get', path=path, property=prop))
             data += '\n'  # make values shell friendly
             data += '\n'  # make values shell friendly
         except ExecuteError as err:
         except ExecuteError as err:
             raise FuseOSError(EPERM) from err
             raise FuseOSError(EPERM) from err
@@ -152,8 +152,8 @@ def readlink(self, path: str) -> Union[bool, str]:
             return False
             return False
         path, prop = path.rsplit('/', 1)
         path, prop = path.rsplit('/', 1)
         prefix = '/'.join(['..'] * (len(path.split('/')) - 1))
         prefix = '/'.join(['..'] * (len(path.split('/')) - 1))
-        return prefix + str(self.qmp.command('qom-get', path=path,
-                                             property=prop))
+        return prefix + str(self.qmp.cmd('qom-get', path=path,
+                                         property=prop))
 
 
     def getattr(self, path: str,
     def getattr(self, path: str,
                 fh: Optional[IO[bytes]] = None) -> Mapping[str, object]:
                 fh: Optional[IO[bytes]] = None) -> Mapping[str, object]:

+ 4 - 4
scripts/cpu-x86-uarch-abi.py

@@ -69,7 +69,7 @@
 shell = QEMUMonitorProtocol(sock)
 shell = QEMUMonitorProtocol(sock)
 shell.connect()
 shell.connect()
 
 
-models = shell.command("query-cpu-definitions")
+models = shell.cmd("query-cpu-definitions")
 
 
 # These QMP props don't correspond to CPUID fatures
 # These QMP props don't correspond to CPUID fatures
 # so ignore them
 # so ignore them
@@ -93,9 +93,9 @@
 models = {}
 models = {}
 
 
 for name in sorted(names):
 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 = {}
     got = {}
     for (feature, present) in cpu["model"]["props"].items():
     for (feature, present) in cpu["model"]["props"].items():

+ 4 - 4
scripts/device-crash-test

@@ -269,14 +269,14 @@ def formatTestCase(t):
 
 
 def qomListTypeNames(vm, **kwargs):
 def qomListTypeNames(vm, **kwargs):
     """Run qom-list-types QMP command, return type names"""
     """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]
     return [t['name'] for t in types]
 
 
 
 
 def infoQDM(vm):
 def infoQDM(vm):
     """Parse 'info qdm' output"""
     """Parse 'info qdm' output"""
     args = {'command-line': 'info qdm'}
     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'):
     for l in devhelp.split('\n'):
         l = l.strip()
         l = l.strip()
         if l == '' or l.endswith(':'):
         if l == '' or l.endswith(':'):
@@ -304,9 +304,9 @@ class QemuBinaryInfo(object):
             # there's no way to query DeviceClass::user_creatable using QMP,
             # there's no way to query DeviceClass::user_creatable using QMP,
             # so use 'info qdm':
             # so use 'info qdm':
             self.no_user_devs = set([d['name'] for d in infoQDM(vm, ) if d['no-user']])
             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.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:
         finally:
             vm.shutdown()
             vm.shutdown()
 
 

+ 4 - 4
scripts/render_block_graph.py

@@ -43,13 +43,13 @@ def render_block_graph(qmp, filename, format='png'):
     representation in @format into "@filename.@format"
     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}
     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}
     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 = Digraph(comment='Block Nodes Graph')
     graph.format = format
     graph.format = format
@@ -94,7 +94,7 @@ class LibvirtGuest():
     def __init__(self, name):
     def __init__(self, name):
         self.name = name
         self.name = name
 
 
-    def command(self, cmd):
+    def cmd(self, cmd):
         # only supports qmp commands without parameters
         # only supports qmp commands without parameters
         m = {'execute': cmd}
         m = {'execute': cmd}
         ar = ['virsh', 'qemu-monitor-command', self.name, json.dumps(m)]
         ar = ['virsh', 'qemu-monitor-command', self.name, json.dumps(m)]

+ 2 - 2
tests/avocado/avocado_qemu/__init__.py

@@ -408,8 +408,8 @@ class LinuxSSHMixIn:
 
 
     def ssh_connect(self, username, credential, credential_is_key=True):
     def ssh_connect(self, username, credential, credential_is_key=True):
         self.ssh_logger = logging.getLogger('ssh')
         self.ssh_logger = logging.getLogger('ssh')
-        res = self.vm.command('human-monitor-command',
-                              command_line='info usernet')
+        res = self.vm.cmd('human-monitor-command',
+                          command_line='info usernet')
         port = get_info_usernet_hostfwd_port(res)
         port = get_info_usernet_hostfwd_port(res)
         self.assertIsNotNone(port)
         self.assertIsNotNone(port)
         self.assertGreater(port, 0)
         self.assertGreater(port, 0)

+ 3 - 2
tests/avocado/cpu_queries.py

@@ -23,12 +23,13 @@ def test(self):
         self.vm.add_args('-S')
         self.vm.add_args('-S')
         self.vm.launch()
         self.vm.launch()
 
 
-        cpus = self.vm.command('query-cpu-definitions')
+        cpus = self.vm.cmd('query-cpu-definitions')
         for c in cpus:
         for c in cpus:
             self.log.info("Checking CPU: %s", c)
             self.log.info("Checking CPU: %s", c)
             self.assertNotIn('', c['unavailable-features'], c['name'])
             self.assertNotIn('', c['unavailable-features'], c['name'])
 
 
         for c in cpus:
         for c in cpus:
             model = {'name': c['name']}
             model = {'name': c['name']}
-            e = self.vm.command('query-cpu-model-expansion', model=model, type='full')
+            e = self.vm.cmd('query-cpu-model-expansion', model=model,
+                            type='full')
             self.assertEquals(e['model']['name'], c['name'])
             self.assertEquals(e['model']['name'], c['name'])

+ 5 - 5
tests/avocado/hotplug_cpu.py

@@ -29,9 +29,9 @@ def test(self):
         with self.assertRaises(AssertionError):
         with self.assertRaises(AssertionError):
             self.ssh_command('test -e /sys/devices/system/cpu/cpu1')
             self.ssh_command('test -e /sys/devices/system/cpu/cpu1')
 
 
-        self.vm.command('device_add',
-                        driver='Haswell-x86_64-cpu',
-                        socket_id=0,
-                        core_id=1,
-                        thread_id=0)
+        self.vm.cmd('device_add',
+                    driver='Haswell-x86_64-cpu',
+                    socket_id=0,
+                    core_id=1,
+                    thread_id=0)
         self.ssh_command('test -e /sys/devices/system/cpu/cpu1')
         self.ssh_command('test -e /sys/devices/system/cpu/cpu1')

+ 2 - 2
tests/avocado/info_usernet.py

@@ -22,8 +22,8 @@ def test_hostfwd(self):
         self.require_netdev('user')
         self.require_netdev('user')
         self.vm.add_args('-netdev', 'user,id=vnet,hostfwd=:127.0.0.1:0-:22')
         self.vm.add_args('-netdev', 'user,id=vnet,hostfwd=:127.0.0.1:0-:22')
         self.vm.launch()
         self.vm.launch()
-        res = self.vm.command('human-monitor-command',
-                              command_line='info usernet')
+        res = self.vm.cmd('human-monitor-command',
+                          command_line='info usernet')
         port = get_info_usernet_hostfwd_port(res)
         port = get_info_usernet_hostfwd_port(res)
         self.assertIsNotNone(port,
         self.assertIsNotNone(port,
                              ('"info usernet" output content does not seem to '
                              ('"info usernet" output content does not seem to '

+ 3 - 3
tests/avocado/machine_arm_integratorcp.py

@@ -81,9 +81,9 @@ def test_framebuffer_tux_logo(self):
         self.boot_integratorcp()
         self.boot_integratorcp()
         framebuffer_ready = 'Console: switching to colour frame buffer device'
         framebuffer_ready = 'Console: switching to colour frame buffer device'
         wait_for_console_pattern(self, framebuffer_ready)
         wait_for_console_pattern(self, framebuffer_ready)
-        self.vm.command('human-monitor-command', command_line='stop')
-        self.vm.command('human-monitor-command',
-                        command_line='screendump %s' % screendump_path)
+        self.vm.cmd('human-monitor-command', command_line='stop')
+        self.vm.cmd('human-monitor-command',
+                    command_line='screendump %s' % screendump_path)
         logger = logging.getLogger('framebuffer')
         logger = logging.getLogger('framebuffer')
 
 
         cpu_count = 1
         cpu_count = 1

+ 6 - 6
tests/avocado/machine_aspeed.py

@@ -181,8 +181,8 @@ def test_arm_ast2500_evb_buildroot(self):
              'i2c i2c-3: new_device: Instantiated device lm75 at 0x4d');
              'i2c i2c-3: new_device: Instantiated device lm75 at 0x4d');
         exec_command_and_wait_for_pattern(self,
         exec_command_and_wait_for_pattern(self,
                              'cat /sys/class/hwmon/hwmon1/temp1_input', '0')
                              'cat /sys/class/hwmon/hwmon1/temp1_input', '0')
-        self.vm.command('qom-set', path='/machine/peripheral/tmp-test',
-                        property='temperature', value=18000);
+        self.vm.cmd('qom-set', path='/machine/peripheral/tmp-test',
+                    property='temperature', value=18000);
         exec_command_and_wait_for_pattern(self,
         exec_command_and_wait_for_pattern(self,
                              'cat /sys/class/hwmon/hwmon1/temp1_input', '18000')
                              'cat /sys/class/hwmon/hwmon1/temp1_input', '18000')
 
 
@@ -213,8 +213,8 @@ def test_arm_ast2600_evb_buildroot(self):
              'i2c i2c-3: new_device: Instantiated device lm75 at 0x4d');
              'i2c i2c-3: new_device: Instantiated device lm75 at 0x4d');
         exec_command_and_wait_for_pattern(self,
         exec_command_and_wait_for_pattern(self,
                              'cat /sys/class/hwmon/hwmon0/temp1_input', '0')
                              'cat /sys/class/hwmon/hwmon0/temp1_input', '0')
-        self.vm.command('qom-set', path='/machine/peripheral/tmp-test',
-                        property='temperature', value=18000);
+        self.vm.cmd('qom-set', path='/machine/peripheral/tmp-test',
+                    property='temperature', value=18000);
         exec_command_and_wait_for_pattern(self,
         exec_command_and_wait_for_pattern(self,
                              'cat /sys/class/hwmon/hwmon0/temp1_input', '18000')
                              'cat /sys/class/hwmon/hwmon0/temp1_input', '18000')
 
 
@@ -360,8 +360,8 @@ def test_arm_ast2600_evb_sdk(self):
              'i2c i2c-5: new_device: Instantiated device lm75 at 0x4d');
              'i2c i2c-5: new_device: Instantiated device lm75 at 0x4d');
         self.ssh_command_output_contains(
         self.ssh_command_output_contains(
                              'cat /sys/class/hwmon/hwmon19/temp1_input', '0')
                              'cat /sys/class/hwmon/hwmon19/temp1_input', '0')
-        self.vm.command('qom-set', path='/machine/peripheral/tmp-test',
-                        property='temperature', value=18000);
+        self.vm.cmd('qom-set', path='/machine/peripheral/tmp-test',
+                    property='temperature', value=18000);
         self.ssh_command_output_contains(
         self.ssh_command_output_contains(
                              'cat /sys/class/hwmon/hwmon19/temp1_input', '18000')
                              'cat /sys/class/hwmon/hwmon19/temp1_input', '18000')
 
 

+ 2 - 2
tests/avocado/machine_m68k_nextcube.py

@@ -43,8 +43,8 @@ def check_bootrom_framebuffer(self, screenshot_path):
         #       'displaysurface_create 1120x832' trace-event.
         #       'displaysurface_create 1120x832' trace-event.
         time.sleep(2)
         time.sleep(2)
 
 
-        self.vm.command('human-monitor-command',
-                        command_line='screendump %s' % screenshot_path)
+        self.vm.cmd('human-monitor-command',
+                    command_line='screendump %s' % screenshot_path)
 
 
     @skipUnless(PIL_AVAILABLE, 'Python PIL not installed')
     @skipUnless(PIL_AVAILABLE, 'Python PIL not installed')
     def test_bootrom_framebuffer_size(self):
     def test_bootrom_framebuffer_size(self):

+ 3 - 3
tests/avocado/machine_mips_malta.py

@@ -71,9 +71,9 @@ def do_test_i6400_framebuffer_logo(self, cpu_cores_count):
         framebuffer_ready = 'Console: switching to colour frame buffer device'
         framebuffer_ready = 'Console: switching to colour frame buffer device'
         wait_for_console_pattern(self, framebuffer_ready,
         wait_for_console_pattern(self, framebuffer_ready,
                                  failure_message='Kernel panic - not syncing')
                                  failure_message='Kernel panic - not syncing')
-        self.vm.command('human-monitor-command', command_line='stop')
-        self.vm.command('human-monitor-command',
-                        command_line='screendump %s' % screendump_path)
+        self.vm.cmd('human-monitor-command', command_line='stop')
+        self.vm.cmd('human-monitor-command',
+                    command_line='screendump %s' % screendump_path)
         logger = logging.getLogger('framebuffer')
         logger = logging.getLogger('framebuffer')
 
 
         match_threshold = 0.95
         match_threshold = 0.95

+ 14 - 14
tests/avocado/machine_s390_ccw_virtio.py

@@ -107,10 +107,10 @@ def test_s390x_devices(self):
                         'dd if=/dev/hwrng of=/dev/null bs=1k count=10',
                         'dd if=/dev/hwrng of=/dev/null bs=1k count=10',
                         '10+0 records out')
                         '10+0 records out')
         self.clear_guest_dmesg()
         self.clear_guest_dmesg()
-        self.vm.command('device_del', id='rn1')
+        self.vm.cmd('device_del', id='rn1')
         self.wait_for_crw_reports()
         self.wait_for_crw_reports()
         self.clear_guest_dmesg()
         self.clear_guest_dmesg()
-        self.vm.command('device_del', id='rn2')
+        self.vm.cmd('device_del', id='rn2')
         self.wait_for_crw_reports()
         self.wait_for_crw_reports()
         exec_command_and_wait_for_pattern(self,
         exec_command_and_wait_for_pattern(self,
                         'dd if=/dev/hwrng of=/dev/null bs=1k count=10',
                         'dd if=/dev/hwrng of=/dev/null bs=1k count=10',
@@ -132,8 +132,8 @@ def test_s390x_devices(self):
                         '0x0000000c')
                         '0x0000000c')
         # add another device
         # add another device
         self.clear_guest_dmesg()
         self.clear_guest_dmesg()
-        self.vm.command('device_add', driver='virtio-net-ccw',
-                        devno='fe.0.4711', id='net_4711')
+        self.vm.cmd('device_add', driver='virtio-net-ccw',
+                    devno='fe.0.4711', id='net_4711')
         self.wait_for_crw_reports()
         self.wait_for_crw_reports()
         exec_command_and_wait_for_pattern(self, 'for i in 1 2 3 4 5 6 7 ; do '
         exec_command_and_wait_for_pattern(self, 'for i in 1 2 3 4 5 6 7 ; do '
                     'if [ -e /sys/bus/ccw/devices/*4711 ]; then break; fi ;'
                     'if [ -e /sys/bus/ccw/devices/*4711 ]; then break; fi ;'
@@ -141,7 +141,7 @@ def test_s390x_devices(self):
                     '0.0.4711')
                     '0.0.4711')
         # and detach it again
         # and detach it again
         self.clear_guest_dmesg()
         self.clear_guest_dmesg()
-        self.vm.command('device_del', id='net_4711')
+        self.vm.cmd('device_del', id='net_4711')
         self.vm.event_wait(name='DEVICE_DELETED',
         self.vm.event_wait(name='DEVICE_DELETED',
                            match={'data': {'device': 'net_4711'}})
                            match={'data': {'device': 'net_4711'}})
         self.wait_for_crw_reports()
         self.wait_for_crw_reports()
@@ -151,10 +151,10 @@ def test_s390x_devices(self):
         # test the virtio-balloon device
         # test the virtio-balloon device
         exec_command_and_wait_for_pattern(self, 'head -n 1 /proc/meminfo',
         exec_command_and_wait_for_pattern(self, 'head -n 1 /proc/meminfo',
                                           'MemTotal:         115640 kB')
                                           'MemTotal:         115640 kB')
-        self.vm.command('human-monitor-command', command_line='balloon 96')
+        self.vm.cmd('human-monitor-command', command_line='balloon 96')
         exec_command_and_wait_for_pattern(self, 'head -n 1 /proc/meminfo',
         exec_command_and_wait_for_pattern(self, 'head -n 1 /proc/meminfo',
                                           'MemTotal:          82872 kB')
                                           'MemTotal:          82872 kB')
-        self.vm.command('human-monitor-command', command_line='balloon 128')
+        self.vm.cmd('human-monitor-command', command_line='balloon 128')
         exec_command_and_wait_for_pattern(self, 'head -n 1 /proc/meminfo',
         exec_command_and_wait_for_pattern(self, 'head -n 1 /proc/meminfo',
                                           'MemTotal:         115640 kB')
                                           'MemTotal:         115640 kB')
 
 
@@ -245,7 +245,7 @@ def test_s390x_fedora(self):
                 '12+0 records out')
                 '12+0 records out')
             with tempfile.NamedTemporaryFile(suffix='.ppm',
             with tempfile.NamedTemporaryFile(suffix='.ppm',
                                              prefix='qemu-scrdump-') as ppmfile:
                                              prefix='qemu-scrdump-') as ppmfile:
-                self.vm.command('screendump', filename=ppmfile.name)
+                self.vm.cmd('screendump', filename=ppmfile.name)
                 ppmfile.seek(0)
                 ppmfile.seek(0)
                 line = ppmfile.readline()
                 line = ppmfile.readline()
                 self.assertEqual(line, b"P6\n")
                 self.assertEqual(line, b"P6\n")
@@ -261,16 +261,16 @@ def test_s390x_fedora(self):
         # Hot-plug a virtio-crypto device and see whether it gets accepted
         # Hot-plug a virtio-crypto device and see whether it gets accepted
         self.log.info("Test hot-plug virtio-crypto device")
         self.log.info("Test hot-plug virtio-crypto device")
         self.clear_guest_dmesg()
         self.clear_guest_dmesg()
-        self.vm.command('object-add', qom_type='cryptodev-backend-builtin',
-                        id='cbe0')
-        self.vm.command('device_add', driver='virtio-crypto-ccw', id='crypdev0',
-                        cryptodev='cbe0', devno='fe.0.2342')
+        self.vm.cmd('object-add', qom_type='cryptodev-backend-builtin',
+                    id='cbe0')
+        self.vm.cmd('device_add', driver='virtio-crypto-ccw', id='crypdev0',
+                    cryptodev='cbe0', devno='fe.0.2342')
         exec_command_and_wait_for_pattern(self,
         exec_command_and_wait_for_pattern(self,
                         'while ! (dmesg -c | grep Accelerator.device) ; do'
                         'while ! (dmesg -c | grep Accelerator.device) ; do'
                         ' sleep 1 ; done', 'Accelerator device is ready')
                         ' sleep 1 ; done', 'Accelerator device is ready')
         exec_command_and_wait_for_pattern(self, 'lscss', '0.0.2342')
         exec_command_and_wait_for_pattern(self, 'lscss', '0.0.2342')
-        self.vm.command('device_del', id='crypdev0')
-        self.vm.command('object-del', id='cbe0')
+        self.vm.cmd('device_del', id='crypdev0')
+        self.vm.cmd('object-del', id='cbe0')
         exec_command_and_wait_for_pattern(self,
         exec_command_and_wait_for_pattern(self,
                         'while ! (dmesg -c | grep Start.virtcrypto_remove) ; do'
                         'while ! (dmesg -c | grep Start.virtcrypto_remove) ; do'
                         ' sleep 1 ; done', 'Start virtcrypto_remove.')
                         ' sleep 1 ; done', 'Start virtcrypto_remove.')

+ 5 - 5
tests/avocado/migration.py

@@ -30,7 +30,7 @@ class MigrationTest(QemuSystemTest):
 
 
     @staticmethod
     @staticmethod
     def migration_finished(vm):
     def migration_finished(vm):
-        return vm.command('query-migrate')['status'] in ('completed', 'failed')
+        return vm.cmd('query-migrate')['status'] in ('completed', 'failed')
 
 
     def assert_migration(self, src_vm, dst_vm):
     def assert_migration(self, src_vm, dst_vm):
         wait.wait_for(self.migration_finished,
         wait.wait_for(self.migration_finished,
@@ -41,10 +41,10 @@ def assert_migration(self, src_vm, dst_vm):
                       timeout=self.timeout,
                       timeout=self.timeout,
                       step=0.1,
                       step=0.1,
                       args=(dst_vm,))
                       args=(dst_vm,))
-        self.assertEqual(src_vm.command('query-migrate')['status'], 'completed')
-        self.assertEqual(dst_vm.command('query-migrate')['status'], 'completed')
-        self.assertEqual(dst_vm.command('query-status')['status'], 'running')
-        self.assertEqual(src_vm.command('query-status')['status'],'postmigrate')
+        self.assertEqual(src_vm.cmd('query-migrate')['status'], 'completed')
+        self.assertEqual(dst_vm.cmd('query-migrate')['status'], 'completed')
+        self.assertEqual(dst_vm.cmd('query-status')['status'], 'running')
+        self.assertEqual(src_vm.cmd('query-status')['status'],'postmigrate')
 
 
     def do_migrate(self, dest_uri, src_uri=None):
     def do_migrate(self, dest_uri, src_uri=None):
         dest_vm = self.get_vm('-incoming', dest_uri)
         dest_vm = self.get_vm('-incoming', dest_uri)

+ 1 - 1
tests/avocado/pc_cpu_hotplug_props.py

@@ -32,4 +32,4 @@ def test_no_die_id(self):
         self.vm.add_args('-smp', '1,sockets=2,cores=2,threads=2,maxcpus=8')
         self.vm.add_args('-smp', '1,sockets=2,cores=2,threads=2,maxcpus=8')
         self.vm.add_args('-device', 'qemu64-x86_64-cpu,socket-id=1,core-id=0,thread-id=0')
         self.vm.add_args('-device', 'qemu64-x86_64-cpu,socket-id=1,core-id=0,thread-id=0')
         self.vm.launch()
         self.vm.launch()
-        self.assertEquals(len(self.vm.command('query-cpus-fast')), 2)
+        self.assertEquals(len(self.vm.cmd('query-cpus-fast')), 2)

+ 2 - 2
tests/avocado/version.py

@@ -20,6 +20,6 @@ class Version(QemuSystemTest):
     def test_qmp_human_info_version(self):
     def test_qmp_human_info_version(self):
         self.vm.add_args('-nodefaults')
         self.vm.add_args('-nodefaults')
         self.vm.launch()
         self.vm.launch()
-        res = self.vm.command('human-monitor-command',
-                              command_line='info version')
+        res = self.vm.cmd('human-monitor-command',
+                          command_line='info version')
         self.assertRegexpMatches(res, r'^(\d+\.\d+\.\d)')
         self.assertRegexpMatches(res, r'^(\d+\.\d+\.\d)')

+ 3 - 3
tests/avocado/virtio_check_params.py

@@ -51,8 +51,8 @@ def query_virtqueue(self, vm, dev_type_name):
         error = None
         error = None
         props = None
         props = None
 
 
-        output = vm.command('human-monitor-command',
-                            command_line = 'info qtree')
+        output = vm.cmd('human-monitor-command',
+                        command_line = 'info qtree')
         props_list = DEV_TYPES[dev_type_name].values();
         props_list = DEV_TYPES[dev_type_name].values();
         pattern = self.make_pattern(props_list)
         pattern = self.make_pattern(props_list)
         res = re.findall(pattern, output)
         res = re.findall(pattern, output)
@@ -121,7 +121,7 @@ def test_machine_types(self):
         # collect all machine types except 'none', 'isapc', 'microvm'
         # collect all machine types except 'none', 'isapc', 'microvm'
         with QEMUMachine(self.qemu_bin) as vm:
         with QEMUMachine(self.qemu_bin) as vm:
             vm.launch()
             vm.launch()
-            machines = [m['name'] for m in vm.command('query-machines')]
+            machines = [m['name'] for m in vm.cmd('query-machines')]
             vm.shutdown()
             vm.shutdown()
         machines.remove('none')
         machines.remove('none')
         machines.remove('isapc')
         machines.remove('isapc')

+ 3 - 2
tests/avocado/virtio_version.py

@@ -48,7 +48,8 @@ def pci_modern_device_id(virtio_devid):
     return virtio_devid + 0x1040
     return virtio_devid + 0x1040
 
 
 def devtype_implements(vm, devtype, implements):
 def devtype_implements(vm, devtype, implements):
-    return devtype in [d['name'] for d in vm.command('qom-list-types', implements=implements)]
+    return devtype in [d['name'] for d in
+                       vm.cmd('qom-list-types', implements=implements)]
 
 
 def get_pci_interfaces(vm, devtype):
 def get_pci_interfaces(vm, devtype):
     interfaces = ('pci-express-device', 'conventional-pci-device')
     interfaces = ('pci-express-device', 'conventional-pci-device')
@@ -78,7 +79,7 @@ def run_device(self, devtype, opts=None, machine='pc'):
             vm.add_args('-S')
             vm.add_args('-S')
             vm.launch()
             vm.launch()
 
 
-            pcibuses = vm.command('query-pci')
+            pcibuses = vm.cmd('query-pci')
             alldevs = [dev for bus in pcibuses for dev in bus['devices']]
             alldevs = [dev for bus in pcibuses for dev in bus['devices']]
             devfortest = [dev for dev in alldevs
             devfortest = [dev for dev in alldevs
                           if dev['qdev_id'] == 'devfortest']
                           if dev['qdev_id'] == 'devfortest']

+ 8 - 5
tests/avocado/x86_cpu_model_versions.py

@@ -84,7 +84,8 @@ def test_4_0_alias_compatibility(self):
         # with older QEMU versions that didn't have the versioned CPU model
         # with older QEMU versions that didn't have the versioned CPU model
         self.vm.add_args('-S')
         self.vm.add_args('-S')
         self.vm.launch()
         self.vm.launch()
-        cpus = dict((m['name'], m) for m in self.vm.command('query-cpu-definitions'))
+        cpus = dict((m['name'], m) for m in
+                    self.vm.cmd('query-cpu-definitions'))
 
 
         self.assertFalse(cpus['Cascadelake-Server']['static'],
         self.assertFalse(cpus['Cascadelake-Server']['static'],
                          'unversioned Cascadelake-Server CPU model must not be static')
                          'unversioned Cascadelake-Server CPU model must not be static')
@@ -115,7 +116,8 @@ def test_4_1_alias(self):
         self.vm.add_args('-S')
         self.vm.add_args('-S')
         self.vm.launch()
         self.vm.launch()
 
 
-        cpus = dict((m['name'], m) for m in self.vm.command('query-cpu-definitions'))
+        cpus = dict((m['name'], m) for m in
+                    self.vm.cmd('query-cpu-definitions'))
 
 
         self.assertFalse(cpus['Cascadelake-Server']['static'],
         self.assertFalse(cpus['Cascadelake-Server']['static'],
                          'unversioned Cascadelake-Server CPU model must not be static')
                          'unversioned Cascadelake-Server CPU model must not be static')
@@ -220,7 +222,8 @@ def test_none_alias(self):
         self.vm.add_args('-S')
         self.vm.add_args('-S')
         self.vm.launch()
         self.vm.launch()
 
 
-        cpus = dict((m['name'], m) for m in self.vm.command('query-cpu-definitions'))
+        cpus = dict((m['name'], m) for m in
+                    self.vm.cmd('query-cpu-definitions'))
 
 
         self.assertFalse(cpus['Cascadelake-Server']['static'],
         self.assertFalse(cpus['Cascadelake-Server']['static'],
                          'unversioned Cascadelake-Server CPU model must not be static')
                          'unversioned Cascadelake-Server CPU model must not be static')
@@ -246,8 +249,8 @@ class CascadelakeArchCapabilities(avocado_qemu.QemuSystemTest):
     :avocado: tags=arch:x86_64
     :avocado: tags=arch:x86_64
     """
     """
     def get_cpu_prop(self, prop):
     def get_cpu_prop(self, prop):
-        cpu_path = self.vm.command('query-cpus-fast')[0].get('qom-path')
-        return self.vm.command('qom-get', path=cpu_path, property=prop)
+        cpu_path = self.vm.cmd('query-cpus-fast')[0].get('qom-path')
+        return self.vm.cmd('qom-get', path=cpu_path, property=prop)
 
 
     def test_4_1(self):
     def test_4_1(self):
         """
         """

+ 75 - 75
tests/migration/guestperf/engine.py

@@ -77,7 +77,7 @@ def _cpu_timing(self, pid):
             return TimingRecord(pid, now, 1000 * (stime + utime) / jiffies_per_sec)
             return TimingRecord(pid, now, 1000 * (stime + utime) / jiffies_per_sec)
 
 
     def _migrate_progress(self, vm):
     def _migrate_progress(self, vm):
-        info = vm.command("query-migrate")
+        info = vm.cmd("query-migrate")
 
 
         if "ram" not in info:
         if "ram" not in info:
             info["ram"] = {}
             info["ram"] = {}
@@ -109,7 +109,7 @@ def _migrate(self, hardware, scenario, src, dst, connect_uri):
         src_vcpu_time = []
         src_vcpu_time = []
         src_pid = src.get_pid()
         src_pid = src.get_pid()
 
 
-        vcpus = src.command("query-cpus-fast")
+        vcpus = src.cmd("query-cpus-fast")
         src_threads = []
         src_threads = []
         for vcpu in vcpus:
         for vcpu in vcpus:
             src_threads.append(vcpu["thread-id"])
             src_threads.append(vcpu["thread-id"])
@@ -128,82 +128,82 @@ def _migrate(self, hardware, scenario, src, dst, connect_uri):
         if self._verbose:
         if self._verbose:
             print("Starting migration")
             print("Starting migration")
         if scenario._auto_converge:
         if scenario._auto_converge:
-            resp = src.command("migrate-set-capabilities",
-                               capabilities = [
-                                   { "capability": "auto-converge",
-                                     "state": True }
-                               ])
-            resp = src.command("migrate-set-parameters",
-                               cpu_throttle_increment=scenario._auto_converge_step)
+            resp = src.cmd("migrate-set-capabilities",
+                           capabilities = [
+                               { "capability": "auto-converge",
+                                 "state": True }
+                           ])
+            resp = src.cmd("migrate-set-parameters",
+                           cpu_throttle_increment=scenario._auto_converge_step)
 
 
         if scenario._post_copy:
         if scenario._post_copy:
-            resp = src.command("migrate-set-capabilities",
-                               capabilities = [
-                                   { "capability": "postcopy-ram",
-                                     "state": True }
-                               ])
-            resp = dst.command("migrate-set-capabilities",
-                               capabilities = [
-                                   { "capability": "postcopy-ram",
-                                     "state": True }
-                               ])
-
-        resp = src.command("migrate-set-parameters",
-                           max_bandwidth=scenario._bandwidth * 1024 * 1024)
-
-        resp = src.command("migrate-set-parameters",
-                           downtime_limit=scenario._downtime)
+            resp = src.cmd("migrate-set-capabilities",
+                           capabilities = [
+                               { "capability": "postcopy-ram",
+                                 "state": True }
+                           ])
+            resp = dst.cmd("migrate-set-capabilities",
+                           capabilities = [
+                               { "capability": "postcopy-ram",
+                                 "state": True }
+                           ])
+
+        resp = src.cmd("migrate-set-parameters",
+                       max_bandwidth=scenario._bandwidth * 1024 * 1024)
+
+        resp = src.cmd("migrate-set-parameters",
+                       downtime_limit=scenario._downtime)
 
 
         if scenario._compression_mt:
         if scenario._compression_mt:
-            resp = src.command("migrate-set-capabilities",
-                               capabilities = [
-                                   { "capability": "compress",
-                                     "state": True }
-                               ])
-            resp = src.command("migrate-set-parameters",
-                               compress_threads=scenario._compression_mt_threads)
-            resp = dst.command("migrate-set-capabilities",
-                               capabilities = [
-                                   { "capability": "compress",
-                                     "state": True }
-                               ])
-            resp = dst.command("migrate-set-parameters",
-                               decompress_threads=scenario._compression_mt_threads)
+            resp = src.cmd("migrate-set-capabilities",
+                           capabilities = [
+                               { "capability": "compress",
+                                 "state": True }
+                           ])
+            resp = src.cmd("migrate-set-parameters",
+                           compress_threads=scenario._compression_mt_threads)
+            resp = dst.cmd("migrate-set-capabilities",
+                           capabilities = [
+                               { "capability": "compress",
+                                 "state": True }
+                           ])
+            resp = dst.cmd("migrate-set-parameters",
+                           decompress_threads=scenario._compression_mt_threads)
 
 
         if scenario._compression_xbzrle:
         if scenario._compression_xbzrle:
-            resp = src.command("migrate-set-capabilities",
-                               capabilities = [
-                                   { "capability": "xbzrle",
-                                     "state": True }
-                               ])
-            resp = dst.command("migrate-set-capabilities",
-                               capabilities = [
-                                   { "capability": "xbzrle",
-                                     "state": True }
-                               ])
-            resp = src.command("migrate-set-parameters",
-                               xbzrle_cache_size=(
-                                   hardware._mem *
-                                   1024 * 1024 * 1024 / 100 *
-                                   scenario._compression_xbzrle_cache))
+            resp = src.cmd("migrate-set-capabilities",
+                           capabilities = [
+                               { "capability": "xbzrle",
+                                 "state": True }
+                           ])
+            resp = dst.cmd("migrate-set-capabilities",
+                           capabilities = [
+                               { "capability": "xbzrle",
+                                 "state": True }
+                           ])
+            resp = src.cmd("migrate-set-parameters",
+                           xbzrle_cache_size=(
+                               hardware._mem *
+                               1024 * 1024 * 1024 / 100 *
+                               scenario._compression_xbzrle_cache))
 
 
         if scenario._multifd:
         if scenario._multifd:
-            resp = src.command("migrate-set-capabilities",
-                               capabilities = [
-                                   { "capability": "multifd",
-                                     "state": True }
-                               ])
-            resp = src.command("migrate-set-parameters",
-                               multifd_channels=scenario._multifd_channels)
-            resp = dst.command("migrate-set-capabilities",
-                               capabilities = [
-                                   { "capability": "multifd",
-                                     "state": True }
-                               ])
-            resp = dst.command("migrate-set-parameters",
-                               multifd_channels=scenario._multifd_channels)
-
-        resp = src.command("migrate", uri=connect_uri)
+            resp = src.cmd("migrate-set-capabilities",
+                           capabilities = [
+                               { "capability": "multifd",
+                                 "state": True }
+                           ])
+            resp = src.cmd("migrate-set-parameters",
+                           multifd_channels=scenario._multifd_channels)
+            resp = dst.cmd("migrate-set-capabilities",
+                           capabilities = [
+                               { "capability": "multifd",
+                                 "state": True }
+                           ])
+            resp = dst.cmd("migrate-set-parameters",
+                           multifd_channels=scenario._multifd_channels)
+
+        resp = src.cmd("migrate", uri=connect_uri)
 
 
         post_copy = False
         post_copy = False
         paused = False
         paused = False
@@ -228,7 +228,7 @@ def _migrate(self, hardware, scenario, src, dst, connect_uri):
 
 
             if progress._status in ("completed", "failed", "cancelled"):
             if progress._status in ("completed", "failed", "cancelled"):
                 if progress._status == "completed" and paused:
                 if progress._status == "completed" and paused:
-                    dst.command("cont")
+                    dst.cmd("cont")
                 if progress_history[-1] != progress:
                 if progress_history[-1] != progress:
                     progress_history.append(progress)
                     progress_history.append(progress)
 
 
@@ -256,13 +256,13 @@ def _migrate(self, hardware, scenario, src, dst, connect_uri):
             if progress._ram._iterations > scenario._max_iters:
             if progress._ram._iterations > scenario._max_iters:
                 if self._verbose:
                 if self._verbose:
                     print("No completion after %d iterations over RAM" % scenario._max_iters)
                     print("No completion after %d iterations over RAM" % scenario._max_iters)
-                src.command("migrate_cancel")
+                src.cmd("migrate_cancel")
                 continue
                 continue
 
 
             if time.time() > (start + scenario._max_time):
             if time.time() > (start + scenario._max_time):
                 if self._verbose:
                 if self._verbose:
                     print("No completion after %d seconds" % scenario._max_time)
                     print("No completion after %d seconds" % scenario._max_time)
-                src.command("migrate_cancel")
+                src.cmd("migrate_cancel")
                 continue
                 continue
 
 
             if (scenario._post_copy and
             if (scenario._post_copy and
@@ -270,7 +270,7 @@ def _migrate(self, hardware, scenario, src, dst, connect_uri):
                 not post_copy):
                 not post_copy):
                 if self._verbose:
                 if self._verbose:
                     print("Switching to post-copy after %d iterations" % scenario._post_copy_iters)
                     print("Switching to post-copy after %d iterations" % scenario._post_copy_iters)
-                resp = src.command("migrate-start-postcopy")
+                resp = src.cmd("migrate-start-postcopy")
                 post_copy = True
                 post_copy = True
 
 
             if (scenario._pause and
             if (scenario._pause and
@@ -278,7 +278,7 @@ def _migrate(self, hardware, scenario, src, dst, connect_uri):
                 not paused):
                 not paused):
                 if self._verbose:
                 if self._verbose:
                     print("Pausing VM after %d iterations" % scenario._pause_iters)
                     print("Pausing VM after %d iterations" % scenario._pause_iters)
-                resp = src.command("stop")
+                resp = src.cmd("stop")
                 paused = True
                 paused = True
 
 
     def _is_ppc64le(self):
     def _is_ppc64le(self):

+ 17 - 17
tests/qemu-iotests/256

@@ -40,25 +40,25 @@ with iotests.FilePath('img0') as img0_path, \
     def create_target(filepath, name, size):
     def create_target(filepath, name, size):
         basename = os.path.basename(filepath)
         basename = os.path.basename(filepath)
         nodename = "file_{}".format(basename)
         nodename = "file_{}".format(basename)
-        log(vm.command('blockdev-create', job_id='job1',
-                       options={
-                           'driver': 'file',
-                           'filename': filepath,
-                           'size': 0,
-                       }))
+        log(vm.cmd('blockdev-create', job_id='job1',
+                   options={
+                       'driver': 'file',
+                       'filename': filepath,
+                       'size': 0,
+                   }))
         vm.run_job('job1')
         vm.run_job('job1')
-        log(vm.command('blockdev-add', driver='file',
-                       node_name=nodename, filename=filepath))
-        log(vm.command('blockdev-create', job_id='job2',
-                       options={
-                           'driver': iotests.imgfmt,
-                           'file': nodename,
-                           'size': size,
-                       }))
+        log(vm.cmd('blockdev-add', driver='file',
+                   node_name=nodename, filename=filepath))
+        log(vm.cmd('blockdev-create', job_id='job2',
+                   options={
+                       'driver': iotests.imgfmt,
+                       'file': nodename,
+                       'size': size,
+                   }))
         vm.run_job('job2')
         vm.run_job('job2')
-        log(vm.command('blockdev-add', driver=iotests.imgfmt,
-                       node_name=name,
-                       file=nodename))
+        log(vm.cmd('blockdev-add', driver=iotests.imgfmt,
+                   node_name=name,
+                   file=nodename))
 
 
     log('--- Preparing images & VM ---\n')
     log('--- Preparing images & VM ---\n')
     vm.add_object('iothread,id=iothread0')
     vm.add_object('iothread,id=iothread0')

+ 18 - 18
tests/qemu-iotests/257

@@ -160,26 +160,26 @@ class Drive:
         file_node_name = "file_{}".format(basename)
         file_node_name = "file_{}".format(basename)
         vm = self.vm
         vm = self.vm
 
 
-        log(vm.command('blockdev-create', job_id='bdc-file-job',
-                       options={
-                           'driver': 'file',
-                           'filename': self.path,
-                           'size': 0,
-                       }))
+        log(vm.cmd('blockdev-create', job_id='bdc-file-job',
+                   options={
+                       'driver': 'file',
+                       'filename': self.path,
+                       'size': 0,
+                   }))
         vm.run_job('bdc-file-job')
         vm.run_job('bdc-file-job')
-        log(vm.command('blockdev-add', driver='file',
-                       node_name=file_node_name, filename=self.path))
-
-        log(vm.command('blockdev-create', job_id='bdc-fmt-job',
-                       options={
-                           'driver': fmt,
-                           'file': file_node_name,
-                           'size': size,
-                       }))
+        log(vm.cmd('blockdev-add', driver='file',
+                   node_name=file_node_name, filename=self.path))
+
+        log(vm.cmd('blockdev-create', job_id='bdc-fmt-job',
+                   options={
+                       'driver': fmt,
+                       'file': file_node_name,
+                       'size': size,
+                   }))
         vm.run_job('bdc-fmt-job')
         vm.run_job('bdc-fmt-job')
-        log(vm.command('blockdev-add', driver=fmt,
-                       node_name=name,
-                       file=file_node_name))
+        log(vm.cmd('blockdev-add', driver=fmt,
+                   node_name=name,
+                   file=file_node_name))
         self.fmt = fmt
         self.fmt = fmt
         self.size = size
         self.size = size
         self.node = name
         self.node = name