diff options
| author | Mark Hatle <mark.hatle@amd.com> | 2024-08-24 13:45:38 -0600 |
|---|---|---|
| committer | Mark Hatle <mark.hatle@amd.com> | 2024-08-27 11:23:38 -0500 |
| commit | 3d0dc636cce43bf50d48cddae98a974e0ffa719b (patch) | |
| tree | 08fa1cab2bcb93b03314920816ae6983d42d6d73 /meta-xilinx-core | |
| parent | 6dfd742c59b2f0451ba32080eacaad52618437fd (diff) | |
| download | meta-xilinx-3d0dc636cce43bf50d48cddae98a974e0ffa719b.tar.gz | |
qemu-xilinx: Backport QMP changes for YP compatibility
Yocto Project scarthgap requries a slightly newer qmp in order for testimage and
other automations to work. Backport the necessary changes to enable the required
interfaces.
Signed-off-by: Mark Hatle <mark.hatle@amd.com>
Diffstat (limited to 'meta-xilinx-core')
3 files changed, 1099 insertions, 0 deletions
diff --git a/meta-xilinx-core/recipes-devtools/qemu/qemu-8.1/0001-python-rename-QEMUMonitorProtocol.cmd-to-cmd_raw.patch b/meta-xilinx-core/recipes-devtools/qemu/qemu-8.1/0001-python-rename-QEMUMonitorProtocol.cmd-to-cmd_raw.patch new file mode 100644 index 00000000..ff7f64ad --- /dev/null +++ b/meta-xilinx-core/recipes-devtools/qemu/qemu-8.1/0001-python-rename-QEMUMonitorProtocol.cmd-to-cmd_raw.patch | |||
| @@ -0,0 +1,81 @@ | |||
| 1 | From 84986d94277de2ac853cb613c37dbafe485f0981 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru> | ||
| 3 | Date: Fri, 6 Oct 2023 18:41:14 +0300 | ||
| 4 | Subject: [PATCH 1/2] python: rename QEMUMonitorProtocol.cmd() to cmd_raw() | ||
| 5 | |||
| 6 | Having cmd() and command() methods in one class doesn't look good. | ||
| 7 | Rename cmd() to cmd_raw(), to show its meaning better. | ||
| 8 | |||
| 9 | We also want to rename command() to cmd() in future, so this commit is | ||
| 10 | a necessary step. | ||
| 11 | |||
| 12 | Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru> | ||
| 13 | Reviewed-by: Eric Blake <eblake@redhat.com> | ||
| 14 | Message-id: 20231006154125.1068348-5-vsementsov@yandex-team.ru | ||
| 15 | Signed-off-by: John Snow <jsnow@redhat.com> | ||
| 16 | |||
| 17 | Upstream-Status: Backport (37274707f6f3868fae7e0055d9a703006fc142d0) | ||
| 18 | Signed-off-by: Mark Hatle <mark.hatle@amd.com> | ||
| 19 | --- | ||
| 20 | python/qemu/machine/machine.py | 2 +- | ||
| 21 | python/qemu/qmp/legacy.py | 8 ++------ | ||
| 22 | tests/qemu-iotests/iotests.py | 2 +- | ||
| 23 | 3 files changed, 4 insertions(+), 8 deletions(-) | ||
| 24 | |||
| 25 | diff --git a/python/qemu/machine/machine.py b/python/qemu/machine/machine.py | ||
| 26 | index c16a0b6fed..82fa8cdddf 100644 | ||
| 27 | --- a/python/qemu/machine/machine.py | ||
| 28 | +++ b/python/qemu/machine/machine.py | ||
| 29 | @@ -686,7 +686,7 @@ def qmp(self, cmd: str, | ||
| 30 | conv_keys = True | ||
| 31 | |||
| 32 | qmp_args = self._qmp_args(conv_keys, args) | ||
| 33 | - ret = self._qmp.cmd(cmd, args=qmp_args) | ||
| 34 | + ret = self._qmp.cmd_raw(cmd, args=qmp_args) | ||
| 35 | if cmd == 'quit' and 'error' not in ret and 'return' in ret: | ||
| 36 | self._quit_issued = True | ||
| 37 | return ret | ||
| 38 | diff --git a/python/qemu/qmp/legacy.py b/python/qemu/qmp/legacy.py | ||
| 39 | index e1e9383978..e5fa1ce9c4 100644 | ||
| 40 | --- a/python/qemu/qmp/legacy.py | ||
| 41 | +++ b/python/qemu/qmp/legacy.py | ||
| 42 | @@ -194,21 +194,17 @@ def cmd_obj(self, qmp_cmd: QMPMessage) -> QMPMessage: | ||
| 43 | ) | ||
| 44 | ) | ||
| 45 | |||
| 46 | - def cmd(self, name: str, | ||
| 47 | - args: Optional[Dict[str, object]] = None, | ||
| 48 | - cmd_id: Optional[object] = None) -> QMPMessage: | ||
| 49 | + def cmd_raw(self, name: str, | ||
| 50 | + args: Optional[Dict[str, object]] = None) -> QMPMessage: | ||
| 51 | """ | ||
| 52 | Build a QMP command and send it to the QMP Monitor. | ||
| 53 | |||
| 54 | :param name: command name (string) | ||
| 55 | :param args: command arguments (dict) | ||
| 56 | - :param cmd_id: command id (dict, list, string or int) | ||
| 57 | """ | ||
| 58 | qmp_cmd: QMPMessage = {'execute': name} | ||
| 59 | if args: | ||
| 60 | qmp_cmd['arguments'] = args | ||
| 61 | - if cmd_id: | ||
| 62 | - qmp_cmd['id'] = cmd_id | ||
| 63 | return self.cmd_obj(qmp_cmd) | ||
| 64 | |||
| 65 | def command(self, cmd: str, **kwds: object) -> QMPReturnValue: | ||
| 66 | diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py | ||
| 67 | index ef66fbd62b..8ffd9fb660 100644 | ||
| 68 | --- a/tests/qemu-iotests/iotests.py | ||
| 69 | +++ b/tests/qemu-iotests/iotests.py | ||
| 70 | @@ -460,7 +460,7 @@ def __init__(self, *args: str, instance_id: str = 'a', qmp: bool = False): | ||
| 71 | def qmp(self, cmd: str, args: Optional[Dict[str, object]] = None) \ | ||
| 72 | -> QMPMessage: | ||
| 73 | assert self._qmp is not None | ||
| 74 | - return self._qmp.cmd(cmd, args) | ||
| 75 | + return self._qmp.cmd_raw(cmd, args) | ||
| 76 | |||
| 77 | def get_qmp(self) -> QEMUMonitorProtocol: | ||
| 78 | assert self._qmp is not None | ||
| 79 | -- | ||
| 80 | 2.34.1 | ||
| 81 | |||
diff --git a/meta-xilinx-core/recipes-devtools/qemu/qemu-8.1/0002-python-qemu-rename-command-to-cmd.patch b/meta-xilinx-core/recipes-devtools/qemu/qemu-8.1/0002-python-qemu-rename-command-to-cmd.patch new file mode 100644 index 00000000..e776a537 --- /dev/null +++ b/meta-xilinx-core/recipes-devtools/qemu/qemu-8.1/0002-python-qemu-rename-command-to-cmd.patch | |||
| @@ -0,0 +1,1011 @@ | |||
| 1 | From a7037d9661d40351b15d8c8bf209b512a7b5047e Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru> | ||
| 3 | Date: Fri, 6 Oct 2023 18:41:15 +0300 | ||
| 4 | Subject: [PATCH 2/2] python/qemu: rename command() to cmd() | ||
| 5 | MIME-Version: 1.0 | ||
| 6 | Content-Type: text/plain; charset=UTF-8 | ||
| 7 | Content-Transfer-Encoding: 8bit | ||
| 8 | |||
| 9 | Use a shorter name. We are going to move in iotests from qmp() to | ||
| 10 | command() where possible. But command() is longer than qmp() and don't | ||
| 11 | look better. Let's rename. | ||
| 12 | |||
| 13 | You can simply grep for '\.command(' and for 'def command(' to check | ||
| 14 | that everything is updated (command() in tests/docker/docker.py is | ||
| 15 | unrelated). | ||
| 16 | |||
| 17 | Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru> | ||
| 18 | Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> | ||
| 19 | Reviewed-by: Eric Blake <eblake@redhat.com> | ||
| 20 | Reviewed-by: Cédric Le Goater <clg@kaod.org> | ||
| 21 | Reviewed-by: Juan Quintela <quintela@redhat.com> | ||
| 22 | Message-id: 20231006154125.1068348-6-vsementsov@yandex-team.ru | ||
| 23 | [vsementsov: also update three occurrences in | ||
| 24 | tests/avocado/machine_aspeed.py and keep r-b] | ||
| 25 | Signed-off-by: John Snow <jsnow@redhat.com> | ||
| 26 | |||
| 27 | Upstream-status: Backport (684750ab4f8a3ad69512b71532408be3ac2547d4) | ||
| 28 | |||
| 29 | Signed-off-by: Mark Hatle <mark.hatle@amd.com> | ||
| 30 | --- | ||
| 31 | docs/devel/testing.rst | 10 +- | ||
| 32 | python/qemu/machine/machine.py | 8 +- | ||
| 33 | python/qemu/qmp/legacy.py | 2 +- | ||
| 34 | python/qemu/qmp/qmp_shell.py | 11 +- | ||
| 35 | python/qemu/utils/qemu_ga_client.py | 2 +- | ||
| 36 | python/qemu/utils/qom.py | 8 +- | ||
| 37 | python/qemu/utils/qom_common.py | 2 +- | ||
| 38 | python/qemu/utils/qom_fuse.py | 6 +- | ||
| 39 | scripts/cpu-x86-uarch-abi.py | 4 +- | ||
| 40 | scripts/device-crash-test | 8 +- | ||
| 41 | scripts/render_block_graph.py | 8 +- | ||
| 42 | tests/avocado/avocado_qemu/__init__.py | 4 +- | ||
| 43 | tests/avocado/cpu_queries.py | 5 +- | ||
| 44 | tests/avocado/hotplug_cpu.py | 10 +- | ||
| 45 | tests/avocado/info_usernet.py | 4 +- | ||
| 46 | tests/avocado/machine_arm_integratorcp.py | 6 +- | ||
| 47 | tests/avocado/machine_aspeed.py | 12 +- | ||
| 48 | tests/avocado/machine_m68k_nextcube.py | 4 +- | ||
| 49 | tests/avocado/machine_mips_malta.py | 6 +- | ||
| 50 | tests/avocado/machine_s390_ccw_virtio.py | 28 ++-- | ||
| 51 | tests/avocado/migration.py | 10 +- | ||
| 52 | tests/avocado/pc_cpu_hotplug_props.py | 2 +- | ||
| 53 | tests/avocado/version.py | 4 +- | ||
| 54 | tests/avocado/virtio_check_params.py | 6 +- | ||
| 55 | tests/avocado/virtio_version.py | 5 +- | ||
| 56 | tests/avocado/x86_cpu_model_versions.py | 13 +- | ||
| 57 | tests/migration/guestperf/engine.py | 150 +++++++++++----------- | ||
| 58 | tests/qemu-iotests/256 | 34 ++--- | ||
| 59 | tests/qemu-iotests/257 | 36 +++--- | ||
| 60 | 29 files changed, 207 insertions(+), 201 deletions(-) | ||
| 61 | |||
| 62 | diff --git a/docs/devel/testing.rst b/docs/devel/testing.rst | ||
| 63 | index b6ad21bed1..dddf1d6140 100644 | ||
| 64 | --- a/docs/devel/testing.rst | ||
| 65 | +++ b/docs/devel/testing.rst | ||
| 66 | @@ -1014,8 +1014,8 @@ class. Here's a simple usage example: | ||
| 67 | """ | ||
| 68 | def test_qmp_human_info_version(self): | ||
| 69 | self.vm.launch() | ||
| 70 | - res = self.vm.command('human-monitor-command', | ||
| 71 | - command_line='info version') | ||
| 72 | + res = self.vm.cmd('human-monitor-command', | ||
| 73 | + command_line='info version') | ||
| 74 | self.assertRegexpMatches(res, r'^(\d+\.\d+\.\d)') | ||
| 75 | |||
| 76 | To execute your test, run: | ||
| 77 | @@ -1065,15 +1065,15 @@ and hypothetical example follows: | ||
| 78 | first_machine.launch() | ||
| 79 | second_machine.launch() | ||
| 80 | |||
| 81 | - first_res = first_machine.command( | ||
| 82 | + first_res = first_machine.cmd( | ||
| 83 | 'human-monitor-command', | ||
| 84 | command_line='info version') | ||
| 85 | |||
| 86 | - second_res = second_machine.command( | ||
| 87 | + second_res = second_machine.cmd( | ||
| 88 | 'human-monitor-command', | ||
| 89 | command_line='info version') | ||
| 90 | |||
| 91 | - third_res = self.get_vm(name='third_machine').command( | ||
| 92 | + third_res = self.get_vm(name='third_machine').cmd( | ||
| 93 | 'human-monitor-command', | ||
| 94 | command_line='info version') | ||
| 95 | |||
| 96 | diff --git a/python/qemu/machine/machine.py b/python/qemu/machine/machine.py | ||
| 97 | index 82fa8cdddf..0c48b76731 100644 | ||
| 98 | --- a/python/qemu/machine/machine.py | ||
| 99 | +++ b/python/qemu/machine/machine.py | ||
| 100 | @@ -691,16 +691,16 @@ def qmp(self, cmd: str, | ||
| 101 | self._quit_issued = True | ||
| 102 | return ret | ||
| 103 | |||
| 104 | - def command(self, cmd: str, | ||
| 105 | - conv_keys: bool = True, | ||
| 106 | - **args: Any) -> QMPReturnValue: | ||
| 107 | + def cmd(self, cmd: str, | ||
| 108 | + conv_keys: bool = True, | ||
| 109 | + **args: Any) -> QMPReturnValue: | ||
| 110 | """ | ||
| 111 | Invoke a QMP command. | ||
| 112 | On success return the response dict. | ||
| 113 | On failure raise an exception. | ||
| 114 | """ | ||
| 115 | qmp_args = self._qmp_args(conv_keys, args) | ||
| 116 | - ret = self._qmp.command(cmd, **qmp_args) | ||
| 117 | + ret = self._qmp.cmd(cmd, **qmp_args) | ||
| 118 | if cmd == 'quit': | ||
| 119 | self._quit_issued = True | ||
| 120 | return ret | ||
| 121 | diff --git a/python/qemu/qmp/legacy.py b/python/qemu/qmp/legacy.py | ||
| 122 | index e5fa1ce9c4..22a2b5616e 100644 | ||
| 123 | --- a/python/qemu/qmp/legacy.py | ||
| 124 | +++ b/python/qemu/qmp/legacy.py | ||
| 125 | @@ -207,7 +207,7 @@ def cmd_raw(self, name: str, | ||
| 126 | qmp_cmd['arguments'] = args | ||
| 127 | return self.cmd_obj(qmp_cmd) | ||
| 128 | |||
| 129 | - def command(self, cmd: str, **kwds: object) -> QMPReturnValue: | ||
| 130 | + def cmd(self, cmd: str, **kwds: object) -> QMPReturnValue: | ||
| 131 | """ | ||
| 132 | Build and send a QMP command to the monitor, report errors if any | ||
| 133 | """ | ||
| 134 | diff --git a/python/qemu/qmp/qmp_shell.py b/python/qemu/qmp/qmp_shell.py | ||
| 135 | index 619ab42ced..08240c16f8 100644 | ||
| 136 | --- a/python/qemu/qmp/qmp_shell.py | ||
| 137 | +++ b/python/qemu/qmp/qmp_shell.py | ||
| 138 | @@ -194,11 +194,12 @@ def close(self) -> None: | ||
| 139 | super().close() | ||
| 140 | |||
| 141 | def _fill_completion(self) -> None: | ||
| 142 | - cmds = self.cmd('query-commands') | ||
| 143 | - if 'error' in cmds: | ||
| 144 | - return | ||
| 145 | - for cmd in cmds['return']: | ||
| 146 | - self._completer.append(cmd['name']) | ||
| 147 | + try: | ||
| 148 | + cmds = cast(List[Dict[str, str]], self.cmd('query-commands')) | ||
| 149 | + for cmd in cmds: | ||
| 150 | + self._completer.append(cmd['name']) | ||
| 151 | + except ExecuteError: | ||
| 152 | + pass | ||
| 153 | |||
| 154 | def _completer_setup(self) -> None: | ||
| 155 | self._completer = QMPCompleter() | ||
| 156 | diff --git a/python/qemu/utils/qemu_ga_client.py b/python/qemu/utils/qemu_ga_client.py | ||
| 157 | index d8411bb2d0..9a665e6e99 100644 | ||
| 158 | --- a/python/qemu/utils/qemu_ga_client.py | ||
| 159 | +++ b/python/qemu/utils/qemu_ga_client.py | ||
| 160 | @@ -64,7 +64,7 @@ | ||
| 161 | class QemuGuestAgent(QEMUMonitorProtocol): | ||
| 162 | def __getattr__(self, name: str) -> Callable[..., Any]: | ||
| 163 | def wrapper(**kwds: object) -> object: | ||
| 164 | - return self.command('guest-' + name.replace('_', '-'), **kwds) | ||
| 165 | + return self.cmd('guest-' + name.replace('_', '-'), **kwds) | ||
| 166 | return wrapper | ||
| 167 | |||
| 168 | |||
| 169 | diff --git a/python/qemu/utils/qom.py b/python/qemu/utils/qom.py | ||
| 170 | index bcf192f477..426a0f245f 100644 | ||
| 171 | --- a/python/qemu/utils/qom.py | ||
| 172 | +++ b/python/qemu/utils/qom.py | ||
| 173 | @@ -84,7 +84,7 @@ def __init__(self, args: argparse.Namespace): | ||
| 174 | self.value = args.value | ||
| 175 | |||
| 176 | def run(self) -> int: | ||
| 177 | - rsp = self.qmp.command( | ||
| 178 | + rsp = self.qmp.cmd( | ||
| 179 | 'qom-set', | ||
| 180 | path=self.path, | ||
| 181 | property=self.prop, | ||
| 182 | @@ -129,7 +129,7 @@ def __init__(self, args: argparse.Namespace): | ||
| 183 | self.prop = tmp[1] | ||
| 184 | |||
| 185 | def run(self) -> int: | ||
| 186 | - rsp = self.qmp.command( | ||
| 187 | + rsp = self.qmp.cmd( | ||
| 188 | 'qom-get', | ||
| 189 | path=self.path, | ||
| 190 | property=self.prop | ||
| 191 | @@ -231,8 +231,8 @@ def _list_node(self, path: str) -> None: | ||
| 192 | if item.child: | ||
| 193 | continue | ||
| 194 | try: | ||
| 195 | - rsp = self.qmp.command('qom-get', path=path, | ||
| 196 | - property=item.name) | ||
| 197 | + rsp = self.qmp.cmd('qom-get', path=path, | ||
| 198 | + property=item.name) | ||
| 199 | print(f" {item.name}: {rsp} ({item.type})") | ||
| 200 | except ExecuteError as err: | ||
| 201 | print(f" {item.name}: <EXCEPTION: {err!s}> ({item.type})") | ||
| 202 | diff --git a/python/qemu/utils/qom_common.py b/python/qemu/utils/qom_common.py | ||
| 203 | index 80da1b2304..dd2c8b1908 100644 | ||
| 204 | --- a/python/qemu/utils/qom_common.py | ||
| 205 | +++ b/python/qemu/utils/qom_common.py | ||
| 206 | @@ -140,7 +140,7 @@ def qom_list(self, path: str) -> List[ObjectPropertyInfo]: | ||
| 207 | """ | ||
| 208 | :return: a strongly typed list from the 'qom-list' command. | ||
| 209 | """ | ||
| 210 | - rsp = self.qmp.command('qom-list', path=path) | ||
| 211 | + rsp = self.qmp.cmd('qom-list', path=path) | ||
| 212 | # qom-list returns List[ObjectPropertyInfo] | ||
| 213 | assert isinstance(rsp, list) | ||
| 214 | return [ObjectPropertyInfo.make(x) for x in rsp] | ||
| 215 | diff --git a/python/qemu/utils/qom_fuse.py b/python/qemu/utils/qom_fuse.py | ||
| 216 | index 8dcd59fcde..cf7e344bd5 100644 | ||
| 217 | --- a/python/qemu/utils/qom_fuse.py | ||
| 218 | +++ b/python/qemu/utils/qom_fuse.py | ||
| 219 | @@ -137,7 +137,7 @@ def read(self, path: str, size: int, offset: int, fh: IO[bytes]) -> bytes: | ||
| 220 | if path == '': | ||
| 221 | path = '/' | ||
| 222 | try: | ||
| 223 | - data = str(self.qmp.command('qom-get', path=path, property=prop)) | ||
| 224 | + data = str(self.qmp.cmd('qom-get', path=path, property=prop)) | ||
| 225 | data += '\n' # make values shell friendly | ||
| 226 | except ExecuteError as err: | ||
| 227 | raise FuseOSError(EPERM) from err | ||
| 228 | @@ -152,8 +152,8 @@ def readlink(self, path: str) -> Union[bool, str]: | ||
| 229 | return False | ||
| 230 | path, prop = path.rsplit('/', 1) | ||
| 231 | prefix = '/'.join(['..'] * (len(path.split('/')) - 1)) | ||
| 232 | - return prefix + str(self.qmp.command('qom-get', path=path, | ||
| 233 | - property=prop)) | ||
| 234 | + return prefix + str(self.qmp.cmd('qom-get', path=path, | ||
| 235 | + property=prop)) | ||
| 236 | |||
| 237 | def getattr(self, path: str, | ||
| 238 | fh: Optional[IO[bytes]] = None) -> Mapping[str, object]: | ||
| 239 | diff --git a/scripts/cpu-x86-uarch-abi.py b/scripts/cpu-x86-uarch-abi.py | ||
| 240 | index 82ff07582f..379a3c64bd 100644 | ||
| 241 | --- a/scripts/cpu-x86-uarch-abi.py | ||
| 242 | +++ b/scripts/cpu-x86-uarch-abi.py | ||
| 243 | @@ -94,8 +94,8 @@ | ||
| 244 | |||
| 245 | for name in sorted(names): | ||
| 246 | cpu = shell.cmd("query-cpu-model-expansion", | ||
| 247 | - { "type": "static", | ||
| 248 | - "model": { "name": name }}) | ||
| 249 | + { "type": "static", | ||
| 250 | + "model": { "name": name }}) | ||
| 251 | |||
| 252 | got = {} | ||
| 253 | for (feature, present) in cpu["return"]["model"]["props"].items(): | ||
| 254 | diff --git a/scripts/device-crash-test b/scripts/device-crash-test | ||
| 255 | index b74d887331..9bf9d0d6e6 100755 | ||
| 256 | --- a/scripts/device-crash-test | ||
| 257 | +++ b/scripts/device-crash-test | ||
| 258 | @@ -269,14 +269,14 @@ def formatTestCase(t): | ||
| 259 | |||
| 260 | def qomListTypeNames(vm, **kwargs): | ||
| 261 | """Run qom-list-types QMP command, return type names""" | ||
| 262 | - types = vm.command('qom-list-types', **kwargs) | ||
| 263 | + types = vm.cmd('qom-list-types', **kwargs) | ||
| 264 | return [t['name'] for t in types] | ||
| 265 | |||
| 266 | |||
| 267 | def infoQDM(vm): | ||
| 268 | """Parse 'info qdm' output""" | ||
| 269 | args = {'command-line': 'info qdm'} | ||
| 270 | - devhelp = vm.command('human-monitor-command', **args) | ||
| 271 | + devhelp = vm.cmd('human-monitor-command', **args) | ||
| 272 | for l in devhelp.split('\n'): | ||
| 273 | l = l.strip() | ||
| 274 | if l == '' or l.endswith(':'): | ||
| 275 | @@ -304,9 +304,9 @@ class QemuBinaryInfo(object): | ||
| 276 | # there's no way to query DeviceClass::user_creatable using QMP, | ||
| 277 | # so use 'info qdm': | ||
| 278 | self.no_user_devs = set([d['name'] for d in infoQDM(vm, ) if d['no-user']]) | ||
| 279 | - self.machines = list(m['name'] for m in vm.command('query-machines')) | ||
| 280 | + self.machines = list(m['name'] for m in vm.cmd('query-machines')) | ||
| 281 | self.user_devs = self.alldevs.difference(self.no_user_devs) | ||
| 282 | - self.kvm_available = vm.command('query-kvm')['enabled'] | ||
| 283 | + self.kvm_available = vm.cmd('query-kvm')['enabled'] | ||
| 284 | finally: | ||
| 285 | vm.shutdown() | ||
| 286 | |||
| 287 | diff --git a/scripts/render_block_graph.py b/scripts/render_block_graph.py | ||
| 288 | index 8f731a5cfe..3e1a2e3fa7 100755 | ||
| 289 | --- a/scripts/render_block_graph.py | ||
| 290 | +++ b/scripts/render_block_graph.py | ||
| 291 | @@ -43,13 +43,13 @@ def render_block_graph(qmp, filename, format='png'): | ||
| 292 | representation in @format into "@filename.@format" | ||
| 293 | ''' | ||
| 294 | |||
| 295 | - bds_nodes = qmp.command('query-named-block-nodes') | ||
| 296 | + bds_nodes = qmp.cmd('query-named-block-nodes') | ||
| 297 | bds_nodes = {n['node-name']: n for n in bds_nodes} | ||
| 298 | |||
| 299 | - job_nodes = qmp.command('query-block-jobs') | ||
| 300 | + job_nodes = qmp.cmd('query-block-jobs') | ||
| 301 | job_nodes = {n['device']: n for n in job_nodes} | ||
| 302 | |||
| 303 | - block_graph = qmp.command('x-debug-query-block-graph') | ||
| 304 | + block_graph = qmp.cmd('x-debug-query-block-graph') | ||
| 305 | |||
| 306 | graph = Digraph(comment='Block Nodes Graph') | ||
| 307 | graph.format = format | ||
| 308 | @@ -94,7 +94,7 @@ class LibvirtGuest(): | ||
| 309 | def __init__(self, name): | ||
| 310 | self.name = name | ||
| 311 | |||
| 312 | - def command(self, cmd): | ||
| 313 | + def cmd(self, cmd): | ||
| 314 | # only supports qmp commands without parameters | ||
| 315 | m = {'execute': cmd} | ||
| 316 | ar = ['virsh', 'qemu-monitor-command', self.name, json.dumps(m)] | ||
| 317 | diff --git a/tests/avocado/avocado_qemu/__init__.py b/tests/avocado/avocado_qemu/__init__.py | ||
| 318 | index 33090903f1..1a4d40a46f 100644 | ||
| 319 | --- a/tests/avocado/avocado_qemu/__init__.py | ||
| 320 | +++ b/tests/avocado/avocado_qemu/__init__.py | ||
| 321 | @@ -408,8 +408,8 @@ class LinuxSSHMixIn: | ||
| 322 | |||
| 323 | def ssh_connect(self, username, credential, credential_is_key=True): | ||
| 324 | self.ssh_logger = logging.getLogger('ssh') | ||
| 325 | - res = self.vm.command('human-monitor-command', | ||
| 326 | - command_line='info usernet') | ||
| 327 | + res = self.vm.cmd('human-monitor-command', | ||
| 328 | + command_line='info usernet') | ||
| 329 | port = get_info_usernet_hostfwd_port(res) | ||
| 330 | self.assertIsNotNone(port) | ||
| 331 | self.assertGreater(port, 0) | ||
| 332 | diff --git a/tests/avocado/cpu_queries.py b/tests/avocado/cpu_queries.py | ||
| 333 | index cf69f69b11..86c2d5c92d 100644 | ||
| 334 | --- a/tests/avocado/cpu_queries.py | ||
| 335 | +++ b/tests/avocado/cpu_queries.py | ||
| 336 | @@ -23,12 +23,13 @@ def test(self): | ||
| 337 | self.vm.add_args('-S') | ||
| 338 | self.vm.launch() | ||
| 339 | |||
| 340 | - cpus = self.vm.command('query-cpu-definitions') | ||
| 341 | + cpus = self.vm.cmd('query-cpu-definitions') | ||
| 342 | for c in cpus: | ||
| 343 | self.log.info("Checking CPU: %s", c) | ||
| 344 | self.assertNotIn('', c['unavailable-features'], c['name']) | ||
| 345 | |||
| 346 | for c in cpus: | ||
| 347 | model = {'name': c['name']} | ||
| 348 | - e = self.vm.command('query-cpu-model-expansion', model=model, type='full') | ||
| 349 | + e = self.vm.cmd('query-cpu-model-expansion', model=model, | ||
| 350 | + type='full') | ||
| 351 | self.assertEquals(e['model']['name'], c['name']) | ||
| 352 | diff --git a/tests/avocado/hotplug_cpu.py b/tests/avocado/hotplug_cpu.py | ||
| 353 | index 6374bf1b54..292bb43e4d 100644 | ||
| 354 | --- a/tests/avocado/hotplug_cpu.py | ||
| 355 | +++ b/tests/avocado/hotplug_cpu.py | ||
| 356 | @@ -29,9 +29,9 @@ def test(self): | ||
| 357 | with self.assertRaises(AssertionError): | ||
| 358 | self.ssh_command('test -e /sys/devices/system/cpu/cpu1') | ||
| 359 | |||
| 360 | - self.vm.command('device_add', | ||
| 361 | - driver='Haswell-x86_64-cpu', | ||
| 362 | - socket_id=0, | ||
| 363 | - core_id=1, | ||
| 364 | - thread_id=0) | ||
| 365 | + self.vm.cmd('device_add', | ||
| 366 | + driver='Haswell-x86_64-cpu', | ||
| 367 | + socket_id=0, | ||
| 368 | + core_id=1, | ||
| 369 | + thread_id=0) | ||
| 370 | self.ssh_command('test -e /sys/devices/system/cpu/cpu1') | ||
| 371 | diff --git a/tests/avocado/info_usernet.py b/tests/avocado/info_usernet.py | ||
| 372 | index fdc4d90c42..e1aa7a6e0a 100644 | ||
| 373 | --- a/tests/avocado/info_usernet.py | ||
| 374 | +++ b/tests/avocado/info_usernet.py | ||
| 375 | @@ -22,8 +22,8 @@ def test_hostfwd(self): | ||
| 376 | self.require_netdev('user') | ||
| 377 | self.vm.add_args('-netdev', 'user,id=vnet,hostfwd=:127.0.0.1:0-:22') | ||
| 378 | self.vm.launch() | ||
| 379 | - res = self.vm.command('human-monitor-command', | ||
| 380 | - command_line='info usernet') | ||
| 381 | + res = self.vm.cmd('human-monitor-command', | ||
| 382 | + command_line='info usernet') | ||
| 383 | port = get_info_usernet_hostfwd_port(res) | ||
| 384 | self.assertIsNotNone(port, | ||
| 385 | ('"info usernet" output content does not seem to ' | ||
| 386 | diff --git a/tests/avocado/machine_arm_integratorcp.py b/tests/avocado/machine_arm_integratorcp.py | ||
| 387 | index 1ffe1073ef..87f5cf3953 100644 | ||
| 388 | --- a/tests/avocado/machine_arm_integratorcp.py | ||
| 389 | +++ b/tests/avocado/machine_arm_integratorcp.py | ||
| 390 | @@ -81,9 +81,9 @@ def test_framebuffer_tux_logo(self): | ||
| 391 | self.boot_integratorcp() | ||
| 392 | framebuffer_ready = 'Console: switching to colour frame buffer device' | ||
| 393 | wait_for_console_pattern(self, framebuffer_ready) | ||
| 394 | - self.vm.command('human-monitor-command', command_line='stop') | ||
| 395 | - self.vm.command('human-monitor-command', | ||
| 396 | - command_line='screendump %s' % screendump_path) | ||
| 397 | + self.vm.cmd('human-monitor-command', command_line='stop') | ||
| 398 | + self.vm.cmd('human-monitor-command', | ||
| 399 | + command_line='screendump %s' % screendump_path) | ||
| 400 | logger = logging.getLogger('framebuffer') | ||
| 401 | |||
| 402 | cpu_count = 1 | ||
| 403 | diff --git a/tests/avocado/machine_aspeed.py b/tests/avocado/machine_aspeed.py | ||
| 404 | index 724ee72c02..68619bbbdc 100644 | ||
| 405 | --- a/tests/avocado/machine_aspeed.py | ||
| 406 | +++ b/tests/avocado/machine_aspeed.py | ||
| 407 | @@ -181,8 +181,8 @@ def test_arm_ast2500_evb_buildroot(self): | ||
| 408 | 'i2c i2c-3: new_device: Instantiated device lm75 at 0x4d'); | ||
| 409 | exec_command_and_wait_for_pattern(self, | ||
| 410 | 'cat /sys/class/hwmon/hwmon1/temp1_input', '0') | ||
| 411 | - self.vm.command('qom-set', path='/machine/peripheral/tmp-test', | ||
| 412 | - property='temperature', value=18000); | ||
| 413 | + self.vm.cmd('qom-set', path='/machine/peripheral/tmp-test', | ||
| 414 | + property='temperature', value=18000); | ||
| 415 | exec_command_and_wait_for_pattern(self, | ||
| 416 | 'cat /sys/class/hwmon/hwmon1/temp1_input', '18000') | ||
| 417 | |||
| 418 | @@ -213,8 +213,8 @@ def test_arm_ast2600_evb_buildroot(self): | ||
| 419 | 'i2c i2c-3: new_device: Instantiated device lm75 at 0x4d'); | ||
| 420 | exec_command_and_wait_for_pattern(self, | ||
| 421 | 'cat /sys/class/hwmon/hwmon0/temp1_input', '0') | ||
| 422 | - self.vm.command('qom-set', path='/machine/peripheral/tmp-test', | ||
| 423 | - property='temperature', value=18000); | ||
| 424 | + self.vm.cmd('qom-set', path='/machine/peripheral/tmp-test', | ||
| 425 | + property='temperature', value=18000); | ||
| 426 | exec_command_and_wait_for_pattern(self, | ||
| 427 | 'cat /sys/class/hwmon/hwmon0/temp1_input', '18000') | ||
| 428 | |||
| 429 | @@ -357,8 +357,8 @@ def test_arm_ast2600_evb_sdk(self): | ||
| 430 | 'i2c i2c-5: new_device: Instantiated device lm75 at 0x4d'); | ||
| 431 | self.ssh_command_output_contains( | ||
| 432 | 'cat /sys/class/hwmon/hwmon19/temp1_input', '0') | ||
| 433 | - self.vm.command('qom-set', path='/machine/peripheral/tmp-test', | ||
| 434 | - property='temperature', value=18000); | ||
| 435 | + self.vm.cmd('qom-set', path='/machine/peripheral/tmp-test', | ||
| 436 | + property='temperature', value=18000); | ||
| 437 | self.ssh_command_output_contains( | ||
| 438 | 'cat /sys/class/hwmon/hwmon19/temp1_input', '18000') | ||
| 439 | |||
| 440 | diff --git a/tests/avocado/machine_m68k_nextcube.py b/tests/avocado/machine_m68k_nextcube.py | ||
| 441 | index 6790e7d9cd..d6da2fbb01 100644 | ||
| 442 | --- a/tests/avocado/machine_m68k_nextcube.py | ||
| 443 | +++ b/tests/avocado/machine_m68k_nextcube.py | ||
| 444 | @@ -43,8 +43,8 @@ def check_bootrom_framebuffer(self, screenshot_path): | ||
| 445 | # 'displaysurface_create 1120x832' trace-event. | ||
| 446 | time.sleep(2) | ||
| 447 | |||
| 448 | - self.vm.command('human-monitor-command', | ||
| 449 | - command_line='screendump %s' % screenshot_path) | ||
| 450 | + self.vm.cmd('human-monitor-command', | ||
| 451 | + command_line='screendump %s' % screenshot_path) | ||
| 452 | |||
| 453 | @skipUnless(PIL_AVAILABLE, 'Python PIL not installed') | ||
| 454 | def test_bootrom_framebuffer_size(self): | ||
| 455 | diff --git a/tests/avocado/machine_mips_malta.py b/tests/avocado/machine_mips_malta.py | ||
| 456 | index 92233451c5..9bd54518bf 100644 | ||
| 457 | --- a/tests/avocado/machine_mips_malta.py | ||
| 458 | +++ b/tests/avocado/machine_mips_malta.py | ||
| 459 | @@ -71,9 +71,9 @@ def do_test_i6400_framebuffer_logo(self, cpu_cores_count): | ||
| 460 | framebuffer_ready = 'Console: switching to colour frame buffer device' | ||
| 461 | wait_for_console_pattern(self, framebuffer_ready, | ||
| 462 | failure_message='Kernel panic - not syncing') | ||
| 463 | - self.vm.command('human-monitor-command', command_line='stop') | ||
| 464 | - self.vm.command('human-monitor-command', | ||
| 465 | - command_line='screendump %s' % screendump_path) | ||
| 466 | + self.vm.cmd('human-monitor-command', command_line='stop') | ||
| 467 | + self.vm.cmd('human-monitor-command', | ||
| 468 | + command_line='screendump %s' % screendump_path) | ||
| 469 | logger = logging.getLogger('framebuffer') | ||
| 470 | |||
| 471 | match_threshold = 0.95 | ||
| 472 | diff --git a/tests/avocado/machine_s390_ccw_virtio.py b/tests/avocado/machine_s390_ccw_virtio.py | ||
| 473 | index e7a2a20ba6..e1f493bc44 100644 | ||
| 474 | --- a/tests/avocado/machine_s390_ccw_virtio.py | ||
| 475 | +++ b/tests/avocado/machine_s390_ccw_virtio.py | ||
| 476 | @@ -107,10 +107,10 @@ def test_s390x_devices(self): | ||
| 477 | 'dd if=/dev/hwrng of=/dev/null bs=1k count=10', | ||
| 478 | '10+0 records out') | ||
| 479 | self.clear_guest_dmesg() | ||
| 480 | - self.vm.command('device_del', id='rn1') | ||
| 481 | + self.vm.cmd('device_del', id='rn1') | ||
| 482 | self.wait_for_crw_reports() | ||
| 483 | self.clear_guest_dmesg() | ||
| 484 | - self.vm.command('device_del', id='rn2') | ||
| 485 | + self.vm.cmd('device_del', id='rn2') | ||
| 486 | self.wait_for_crw_reports() | ||
| 487 | exec_command_and_wait_for_pattern(self, | ||
| 488 | 'dd if=/dev/hwrng of=/dev/null bs=1k count=10', | ||
| 489 | @@ -132,8 +132,8 @@ def test_s390x_devices(self): | ||
| 490 | '0x0000000c') | ||
| 491 | # add another device | ||
| 492 | self.clear_guest_dmesg() | ||
| 493 | - self.vm.command('device_add', driver='virtio-net-ccw', | ||
| 494 | - devno='fe.0.4711', id='net_4711') | ||
| 495 | + self.vm.cmd('device_add', driver='virtio-net-ccw', | ||
| 496 | + devno='fe.0.4711', id='net_4711') | ||
| 497 | self.wait_for_crw_reports() | ||
| 498 | exec_command_and_wait_for_pattern(self, 'for i in 1 2 3 4 5 6 7 ; do ' | ||
| 499 | 'if [ -e /sys/bus/ccw/devices/*4711 ]; then break; fi ;' | ||
| 500 | @@ -141,7 +141,7 @@ def test_s390x_devices(self): | ||
| 501 | '0.0.4711') | ||
| 502 | # and detach it again | ||
| 503 | self.clear_guest_dmesg() | ||
| 504 | - self.vm.command('device_del', id='net_4711') | ||
| 505 | + self.vm.cmd('device_del', id='net_4711') | ||
| 506 | self.vm.event_wait(name='DEVICE_DELETED', | ||
| 507 | match={'data': {'device': 'net_4711'}}) | ||
| 508 | self.wait_for_crw_reports() | ||
| 509 | @@ -151,10 +151,10 @@ def test_s390x_devices(self): | ||
| 510 | # test the virtio-balloon device | ||
| 511 | exec_command_and_wait_for_pattern(self, 'head -n 1 /proc/meminfo', | ||
| 512 | 'MemTotal: 115640 kB') | ||
| 513 | - self.vm.command('human-monitor-command', command_line='balloon 96') | ||
| 514 | + self.vm.cmd('human-monitor-command', command_line='balloon 96') | ||
| 515 | exec_command_and_wait_for_pattern(self, 'head -n 1 /proc/meminfo', | ||
| 516 | 'MemTotal: 82872 kB') | ||
| 517 | - self.vm.command('human-monitor-command', command_line='balloon 128') | ||
| 518 | + self.vm.cmd('human-monitor-command', command_line='balloon 128') | ||
| 519 | exec_command_and_wait_for_pattern(self, 'head -n 1 /proc/meminfo', | ||
| 520 | 'MemTotal: 115640 kB') | ||
| 521 | |||
| 522 | @@ -245,7 +245,7 @@ def test_s390x_fedora(self): | ||
| 523 | '12+0 records out') | ||
| 524 | with tempfile.NamedTemporaryFile(suffix='.ppm', | ||
| 525 | prefix='qemu-scrdump-') as ppmfile: | ||
| 526 | - self.vm.command('screendump', filename=ppmfile.name) | ||
| 527 | + self.vm.cmd('screendump', filename=ppmfile.name) | ||
| 528 | ppmfile.seek(0) | ||
| 529 | line = ppmfile.readline() | ||
| 530 | self.assertEqual(line, b"P6\n") | ||
| 531 | @@ -261,16 +261,16 @@ def test_s390x_fedora(self): | ||
| 532 | # Hot-plug a virtio-crypto device and see whether it gets accepted | ||
| 533 | self.log.info("Test hot-plug virtio-crypto device") | ||
| 534 | self.clear_guest_dmesg() | ||
| 535 | - self.vm.command('object-add', qom_type='cryptodev-backend-builtin', | ||
| 536 | - id='cbe0') | ||
| 537 | - self.vm.command('device_add', driver='virtio-crypto-ccw', id='crypdev0', | ||
| 538 | - cryptodev='cbe0', devno='fe.0.2342') | ||
| 539 | + self.vm.cmd('object-add', qom_type='cryptodev-backend-builtin', | ||
| 540 | + id='cbe0') | ||
| 541 | + self.vm.cmd('device_add', driver='virtio-crypto-ccw', id='crypdev0', | ||
| 542 | + cryptodev='cbe0', devno='fe.0.2342') | ||
| 543 | exec_command_and_wait_for_pattern(self, | ||
| 544 | 'while ! (dmesg -c | grep Accelerator.device) ; do' | ||
| 545 | ' sleep 1 ; done', 'Accelerator device is ready') | ||
| 546 | exec_command_and_wait_for_pattern(self, 'lscss', '0.0.2342') | ||
| 547 | - self.vm.command('device_del', id='crypdev0') | ||
| 548 | - self.vm.command('object-del', id='cbe0') | ||
| 549 | + self.vm.cmd('device_del', id='crypdev0') | ||
| 550 | + self.vm.cmd('object-del', id='cbe0') | ||
| 551 | exec_command_and_wait_for_pattern(self, | ||
| 552 | 'while ! (dmesg -c | grep Start.virtcrypto_remove) ; do' | ||
| 553 | ' sleep 1 ; done', 'Start virtcrypto_remove.') | ||
| 554 | diff --git a/tests/avocado/migration.py b/tests/avocado/migration.py | ||
| 555 | index fdc1d234fb..09b62f813e 100644 | ||
| 556 | --- a/tests/avocado/migration.py | ||
| 557 | +++ b/tests/avocado/migration.py | ||
| 558 | @@ -30,7 +30,7 @@ class MigrationTest(QemuSystemTest): | ||
| 559 | |||
| 560 | @staticmethod | ||
| 561 | def migration_finished(vm): | ||
| 562 | - return vm.command('query-migrate')['status'] in ('completed', 'failed') | ||
| 563 | + return vm.cmd('query-migrate')['status'] in ('completed', 'failed') | ||
| 564 | |||
| 565 | def assert_migration(self, src_vm, dst_vm): | ||
| 566 | wait.wait_for(self.migration_finished, | ||
| 567 | @@ -41,10 +41,10 @@ def assert_migration(self, src_vm, dst_vm): | ||
| 568 | timeout=self.timeout, | ||
| 569 | step=0.1, | ||
| 570 | args=(dst_vm,)) | ||
| 571 | - self.assertEqual(src_vm.command('query-migrate')['status'], 'completed') | ||
| 572 | - self.assertEqual(dst_vm.command('query-migrate')['status'], 'completed') | ||
| 573 | - self.assertEqual(dst_vm.command('query-status')['status'], 'running') | ||
| 574 | - self.assertEqual(src_vm.command('query-status')['status'],'postmigrate') | ||
| 575 | + self.assertEqual(src_vm.cmd('query-migrate')['status'], 'completed') | ||
| 576 | + self.assertEqual(dst_vm.cmd('query-migrate')['status'], 'completed') | ||
| 577 | + self.assertEqual(dst_vm.cmd('query-status')['status'], 'running') | ||
| 578 | + self.assertEqual(src_vm.cmd('query-status')['status'],'postmigrate') | ||
| 579 | |||
| 580 | def do_migrate(self, dest_uri, src_uri=None): | ||
| 581 | dest_vm = self.get_vm('-incoming', dest_uri) | ||
| 582 | diff --git a/tests/avocado/pc_cpu_hotplug_props.py b/tests/avocado/pc_cpu_hotplug_props.py | ||
| 583 | index 52b878188e..b56f51d02a 100644 | ||
| 584 | --- a/tests/avocado/pc_cpu_hotplug_props.py | ||
| 585 | +++ b/tests/avocado/pc_cpu_hotplug_props.py | ||
| 586 | @@ -32,4 +32,4 @@ def test_no_die_id(self): | ||
| 587 | self.vm.add_args('-smp', '1,sockets=2,cores=2,threads=2,maxcpus=8') | ||
| 588 | self.vm.add_args('-device', 'qemu64-x86_64-cpu,socket-id=1,core-id=0,thread-id=0') | ||
| 589 | self.vm.launch() | ||
| 590 | - self.assertEquals(len(self.vm.command('query-cpus-fast')), 2) | ||
| 591 | + self.assertEquals(len(self.vm.cmd('query-cpus-fast')), 2) | ||
| 592 | diff --git a/tests/avocado/version.py b/tests/avocado/version.py | ||
| 593 | index dd775955eb..93ffdf3d97 100644 | ||
| 594 | --- a/tests/avocado/version.py | ||
| 595 | +++ b/tests/avocado/version.py | ||
| 596 | @@ -20,6 +20,6 @@ class Version(QemuSystemTest): | ||
| 597 | def test_qmp_human_info_version(self): | ||
| 598 | self.vm.add_args('-nodefaults') | ||
| 599 | self.vm.launch() | ||
| 600 | - res = self.vm.command('human-monitor-command', | ||
| 601 | - command_line='info version') | ||
| 602 | + res = self.vm.cmd('human-monitor-command', | ||
| 603 | + command_line='info version') | ||
| 604 | self.assertRegexpMatches(res, r'^(\d+\.\d+\.\d)') | ||
| 605 | diff --git a/tests/avocado/virtio_check_params.py b/tests/avocado/virtio_check_params.py | ||
| 606 | index 4093da8a67..f4314ef824 100644 | ||
| 607 | --- a/tests/avocado/virtio_check_params.py | ||
| 608 | +++ b/tests/avocado/virtio_check_params.py | ||
| 609 | @@ -51,8 +51,8 @@ def query_virtqueue(self, vm, dev_type_name): | ||
| 610 | error = None | ||
| 611 | props = None | ||
| 612 | |||
| 613 | - output = vm.command('human-monitor-command', | ||
| 614 | - command_line = 'info qtree') | ||
| 615 | + output = vm.cmd('human-monitor-command', | ||
| 616 | + command_line = 'info qtree') | ||
| 617 | props_list = DEV_TYPES[dev_type_name].values(); | ||
| 618 | pattern = self.make_pattern(props_list) | ||
| 619 | res = re.findall(pattern, output) | ||
| 620 | @@ -121,7 +121,7 @@ def test_machine_types(self): | ||
| 621 | # collect all machine types except 'none', 'isapc', 'microvm' | ||
| 622 | with QEMUMachine(self.qemu_bin) as vm: | ||
| 623 | vm.launch() | ||
| 624 | - machines = [m['name'] for m in vm.command('query-machines')] | ||
| 625 | + machines = [m['name'] for m in vm.cmd('query-machines')] | ||
| 626 | vm.shutdown() | ||
| 627 | machines.remove('none') | ||
| 628 | machines.remove('isapc') | ||
| 629 | diff --git a/tests/avocado/virtio_version.py b/tests/avocado/virtio_version.py | ||
| 630 | index c84e48813a..afe5e828b5 100644 | ||
| 631 | --- a/tests/avocado/virtio_version.py | ||
| 632 | +++ b/tests/avocado/virtio_version.py | ||
| 633 | @@ -48,7 +48,8 @@ def pci_modern_device_id(virtio_devid): | ||
| 634 | return virtio_devid + 0x1040 | ||
| 635 | |||
| 636 | def devtype_implements(vm, devtype, implements): | ||
| 637 | - return devtype in [d['name'] for d in vm.command('qom-list-types', implements=implements)] | ||
| 638 | + return devtype in [d['name'] for d in | ||
| 639 | + vm.cmd('qom-list-types', implements=implements)] | ||
| 640 | |||
| 641 | def get_pci_interfaces(vm, devtype): | ||
| 642 | interfaces = ('pci-express-device', 'conventional-pci-device') | ||
| 643 | @@ -78,7 +79,7 @@ def run_device(self, devtype, opts=None, machine='pc'): | ||
| 644 | vm.add_args('-S') | ||
| 645 | vm.launch() | ||
| 646 | |||
| 647 | - pcibuses = vm.command('query-pci') | ||
| 648 | + pcibuses = vm.cmd('query-pci') | ||
| 649 | alldevs = [dev for bus in pcibuses for dev in bus['devices']] | ||
| 650 | devfortest = [dev for dev in alldevs | ||
| 651 | if dev['qdev_id'] == 'devfortest'] | ||
| 652 | diff --git a/tests/avocado/x86_cpu_model_versions.py b/tests/avocado/x86_cpu_model_versions.py | ||
| 653 | index a6edf74c1c..9e07b8a55d 100644 | ||
| 654 | --- a/tests/avocado/x86_cpu_model_versions.py | ||
| 655 | +++ b/tests/avocado/x86_cpu_model_versions.py | ||
| 656 | @@ -84,7 +84,8 @@ def test_4_0_alias_compatibility(self): | ||
| 657 | # with older QEMU versions that didn't have the versioned CPU model | ||
| 658 | self.vm.add_args('-S') | ||
| 659 | self.vm.launch() | ||
| 660 | - cpus = dict((m['name'], m) for m in self.vm.command('query-cpu-definitions')) | ||
| 661 | + cpus = dict((m['name'], m) for m in | ||
| 662 | + self.vm.cmd('query-cpu-definitions')) | ||
| 663 | |||
| 664 | self.assertFalse(cpus['Cascadelake-Server']['static'], | ||
| 665 | 'unversioned Cascadelake-Server CPU model must not be static') | ||
| 666 | @@ -115,7 +116,8 @@ def test_4_1_alias(self): | ||
| 667 | self.vm.add_args('-S') | ||
| 668 | self.vm.launch() | ||
| 669 | |||
| 670 | - cpus = dict((m['name'], m) for m in self.vm.command('query-cpu-definitions')) | ||
| 671 | + cpus = dict((m['name'], m) for m in | ||
| 672 | + self.vm.cmd('query-cpu-definitions')) | ||
| 673 | |||
| 674 | self.assertFalse(cpus['Cascadelake-Server']['static'], | ||
| 675 | 'unversioned Cascadelake-Server CPU model must not be static') | ||
| 676 | @@ -220,7 +222,8 @@ def test_none_alias(self): | ||
| 677 | self.vm.add_args('-S') | ||
| 678 | self.vm.launch() | ||
| 679 | |||
| 680 | - cpus = dict((m['name'], m) for m in self.vm.command('query-cpu-definitions')) | ||
| 681 | + cpus = dict((m['name'], m) for m in | ||
| 682 | + self.vm.cmd('query-cpu-definitions')) | ||
| 683 | |||
| 684 | self.assertFalse(cpus['Cascadelake-Server']['static'], | ||
| 685 | 'unversioned Cascadelake-Server CPU model must not be static') | ||
| 686 | @@ -246,8 +249,8 @@ class CascadelakeArchCapabilities(avocado_qemu.QemuSystemTest): | ||
| 687 | :avocado: tags=arch:x86_64 | ||
| 688 | """ | ||
| 689 | def get_cpu_prop(self, prop): | ||
| 690 | - cpu_path = self.vm.command('query-cpus-fast')[0].get('qom-path') | ||
| 691 | - return self.vm.command('qom-get', path=cpu_path, property=prop) | ||
| 692 | + cpu_path = self.vm.cmd('query-cpus-fast')[0].get('qom-path') | ||
| 693 | + return self.vm.cmd('qom-get', path=cpu_path, property=prop) | ||
| 694 | |||
| 695 | def test_4_1(self): | ||
| 696 | """ | ||
| 697 | diff --git a/tests/migration/guestperf/engine.py b/tests/migration/guestperf/engine.py | ||
| 698 | index e69d16a62c..da96ca034a 100644 | ||
| 699 | --- a/tests/migration/guestperf/engine.py | ||
| 700 | +++ b/tests/migration/guestperf/engine.py | ||
| 701 | @@ -77,7 +77,7 @@ def _cpu_timing(self, pid): | ||
| 702 | return TimingRecord(pid, now, 1000 * (stime + utime) / jiffies_per_sec) | ||
| 703 | |||
| 704 | def _migrate_progress(self, vm): | ||
| 705 | - info = vm.command("query-migrate") | ||
| 706 | + info = vm.cmd("query-migrate") | ||
| 707 | |||
| 708 | if "ram" not in info: | ||
| 709 | info["ram"] = {} | ||
| 710 | @@ -109,7 +109,7 @@ def _migrate(self, hardware, scenario, src, dst, connect_uri): | ||
| 711 | src_vcpu_time = [] | ||
| 712 | src_pid = src.get_pid() | ||
| 713 | |||
| 714 | - vcpus = src.command("query-cpus-fast") | ||
| 715 | + vcpus = src.cmd("query-cpus-fast") | ||
| 716 | src_threads = [] | ||
| 717 | for vcpu in vcpus: | ||
| 718 | src_threads.append(vcpu["thread-id"]) | ||
| 719 | @@ -128,82 +128,82 @@ def _migrate(self, hardware, scenario, src, dst, connect_uri): | ||
| 720 | if self._verbose: | ||
| 721 | print("Starting migration") | ||
| 722 | if scenario._auto_converge: | ||
| 723 | - resp = src.command("migrate-set-capabilities", | ||
| 724 | - capabilities = [ | ||
| 725 | - { "capability": "auto-converge", | ||
| 726 | - "state": True } | ||
| 727 | - ]) | ||
| 728 | - resp = src.command("migrate-set-parameters", | ||
| 729 | - cpu_throttle_increment=scenario._auto_converge_step) | ||
| 730 | + resp = src.cmd("migrate-set-capabilities", | ||
| 731 | + capabilities = [ | ||
| 732 | + { "capability": "auto-converge", | ||
| 733 | + "state": True } | ||
| 734 | + ]) | ||
| 735 | + resp = src.cmd("migrate-set-parameters", | ||
| 736 | + cpu_throttle_increment=scenario._auto_converge_step) | ||
| 737 | |||
| 738 | if scenario._post_copy: | ||
| 739 | - resp = src.command("migrate-set-capabilities", | ||
| 740 | - capabilities = [ | ||
| 741 | - { "capability": "postcopy-ram", | ||
| 742 | - "state": True } | ||
| 743 | - ]) | ||
| 744 | - resp = dst.command("migrate-set-capabilities", | ||
| 745 | - capabilities = [ | ||
| 746 | - { "capability": "postcopy-ram", | ||
| 747 | - "state": True } | ||
| 748 | - ]) | ||
| 749 | - | ||
| 750 | - resp = src.command("migrate-set-parameters", | ||
| 751 | - max_bandwidth=scenario._bandwidth * 1024 * 1024) | ||
| 752 | - | ||
| 753 | - resp = src.command("migrate-set-parameters", | ||
| 754 | - downtime_limit=scenario._downtime) | ||
| 755 | + resp = src.cmd("migrate-set-capabilities", | ||
| 756 | + capabilities = [ | ||
| 757 | + { "capability": "postcopy-ram", | ||
| 758 | + "state": True } | ||
| 759 | + ]) | ||
| 760 | + resp = dst.cmd("migrate-set-capabilities", | ||
| 761 | + capabilities = [ | ||
| 762 | + { "capability": "postcopy-ram", | ||
| 763 | + "state": True } | ||
| 764 | + ]) | ||
| 765 | + | ||
| 766 | + resp = src.cmd("migrate-set-parameters", | ||
| 767 | + max_bandwidth=scenario._bandwidth * 1024 * 1024) | ||
| 768 | + | ||
| 769 | + resp = src.cmd("migrate-set-parameters", | ||
| 770 | + downtime_limit=scenario._downtime) | ||
| 771 | |||
| 772 | if scenario._compression_mt: | ||
| 773 | - resp = src.command("migrate-set-capabilities", | ||
| 774 | - capabilities = [ | ||
| 775 | - { "capability": "compress", | ||
| 776 | - "state": True } | ||
| 777 | - ]) | ||
| 778 | - resp = src.command("migrate-set-parameters", | ||
| 779 | - compress_threads=scenario._compression_mt_threads) | ||
| 780 | - resp = dst.command("migrate-set-capabilities", | ||
| 781 | - capabilities = [ | ||
| 782 | - { "capability": "compress", | ||
| 783 | - "state": True } | ||
| 784 | - ]) | ||
| 785 | - resp = dst.command("migrate-set-parameters", | ||
| 786 | - decompress_threads=scenario._compression_mt_threads) | ||
| 787 | + resp = src.cmd("migrate-set-capabilities", | ||
| 788 | + capabilities = [ | ||
| 789 | + { "capability": "compress", | ||
| 790 | + "state": True } | ||
| 791 | + ]) | ||
| 792 | + resp = src.cmd("migrate-set-parameters", | ||
| 793 | + compress_threads=scenario._compression_mt_threads) | ||
| 794 | + resp = dst.cmd("migrate-set-capabilities", | ||
| 795 | + capabilities = [ | ||
| 796 | + { "capability": "compress", | ||
| 797 | + "state": True } | ||
| 798 | + ]) | ||
| 799 | + resp = dst.cmd("migrate-set-parameters", | ||
| 800 | + decompress_threads=scenario._compression_mt_threads) | ||
| 801 | |||
| 802 | if scenario._compression_xbzrle: | ||
| 803 | - resp = src.command("migrate-set-capabilities", | ||
| 804 | - capabilities = [ | ||
| 805 | - { "capability": "xbzrle", | ||
| 806 | - "state": True } | ||
| 807 | - ]) | ||
| 808 | - resp = dst.command("migrate-set-capabilities", | ||
| 809 | - capabilities = [ | ||
| 810 | - { "capability": "xbzrle", | ||
| 811 | - "state": True } | ||
| 812 | - ]) | ||
| 813 | - resp = src.command("migrate-set-parameters", | ||
| 814 | - xbzrle_cache_size=( | ||
| 815 | - hardware._mem * | ||
| 816 | - 1024 * 1024 * 1024 / 100 * | ||
| 817 | - scenario._compression_xbzrle_cache)) | ||
| 818 | + resp = src.cmd("migrate-set-capabilities", | ||
| 819 | + capabilities = [ | ||
| 820 | + { "capability": "xbzrle", | ||
| 821 | + "state": True } | ||
| 822 | + ]) | ||
| 823 | + resp = dst.cmd("migrate-set-capabilities", | ||
| 824 | + capabilities = [ | ||
| 825 | + { "capability": "xbzrle", | ||
| 826 | + "state": True } | ||
| 827 | + ]) | ||
| 828 | + resp = src.cmd("migrate-set-parameters", | ||
| 829 | + xbzrle_cache_size=( | ||
| 830 | + hardware._mem * | ||
| 831 | + 1024 * 1024 * 1024 / 100 * | ||
| 832 | + scenario._compression_xbzrle_cache)) | ||
| 833 | |||
| 834 | if scenario._multifd: | ||
| 835 | - resp = src.command("migrate-set-capabilities", | ||
| 836 | - capabilities = [ | ||
| 837 | - { "capability": "multifd", | ||
| 838 | - "state": True } | ||
| 839 | - ]) | ||
| 840 | - resp = src.command("migrate-set-parameters", | ||
| 841 | - multifd_channels=scenario._multifd_channels) | ||
| 842 | - resp = dst.command("migrate-set-capabilities", | ||
| 843 | - capabilities = [ | ||
| 844 | - { "capability": "multifd", | ||
| 845 | - "state": True } | ||
| 846 | - ]) | ||
| 847 | - resp = dst.command("migrate-set-parameters", | ||
| 848 | - multifd_channels=scenario._multifd_channels) | ||
| 849 | - | ||
| 850 | - resp = src.command("migrate", uri=connect_uri) | ||
| 851 | + resp = src.cmd("migrate-set-capabilities", | ||
| 852 | + capabilities = [ | ||
| 853 | + { "capability": "multifd", | ||
| 854 | + "state": True } | ||
| 855 | + ]) | ||
| 856 | + resp = src.cmd("migrate-set-parameters", | ||
| 857 | + multifd_channels=scenario._multifd_channels) | ||
| 858 | + resp = dst.cmd("migrate-set-capabilities", | ||
| 859 | + capabilities = [ | ||
| 860 | + { "capability": "multifd", | ||
| 861 | + "state": True } | ||
| 862 | + ]) | ||
| 863 | + resp = dst.cmd("migrate-set-parameters", | ||
| 864 | + multifd_channels=scenario._multifd_channels) | ||
| 865 | + | ||
| 866 | + resp = src.cmd("migrate", uri=connect_uri) | ||
| 867 | |||
| 868 | post_copy = False | ||
| 869 | paused = False | ||
| 870 | @@ -228,7 +228,7 @@ def _migrate(self, hardware, scenario, src, dst, connect_uri): | ||
| 871 | |||
| 872 | if progress._status in ("completed", "failed", "cancelled"): | ||
| 873 | if progress._status == "completed" and paused: | ||
| 874 | - dst.command("cont") | ||
| 875 | + dst.cmd("cont") | ||
| 876 | if progress_history[-1] != progress: | ||
| 877 | progress_history.append(progress) | ||
| 878 | |||
| 879 | @@ -256,13 +256,13 @@ def _migrate(self, hardware, scenario, src, dst, connect_uri): | ||
| 880 | if progress._ram._iterations > scenario._max_iters: | ||
| 881 | if self._verbose: | ||
| 882 | print("No completion after %d iterations over RAM" % scenario._max_iters) | ||
| 883 | - src.command("migrate_cancel") | ||
| 884 | + src.cmd("migrate_cancel") | ||
| 885 | continue | ||
| 886 | |||
| 887 | if time.time() > (start + scenario._max_time): | ||
| 888 | if self._verbose: | ||
| 889 | print("No completion after %d seconds" % scenario._max_time) | ||
| 890 | - src.command("migrate_cancel") | ||
| 891 | + src.cmd("migrate_cancel") | ||
| 892 | continue | ||
| 893 | |||
| 894 | if (scenario._post_copy and | ||
| 895 | @@ -270,7 +270,7 @@ def _migrate(self, hardware, scenario, src, dst, connect_uri): | ||
| 896 | not post_copy): | ||
| 897 | if self._verbose: | ||
| 898 | print("Switching to post-copy after %d iterations" % scenario._post_copy_iters) | ||
| 899 | - resp = src.command("migrate-start-postcopy") | ||
| 900 | + resp = src.cmd("migrate-start-postcopy") | ||
| 901 | post_copy = True | ||
| 902 | |||
| 903 | if (scenario._pause and | ||
| 904 | @@ -278,7 +278,7 @@ def _migrate(self, hardware, scenario, src, dst, connect_uri): | ||
| 905 | not paused): | ||
| 906 | if self._verbose: | ||
| 907 | print("Pausing VM after %d iterations" % scenario._pause_iters) | ||
| 908 | - resp = src.command("stop") | ||
| 909 | + resp = src.cmd("stop") | ||
| 910 | paused = True | ||
| 911 | |||
| 912 | def _is_ppc64le(self): | ||
| 913 | diff --git a/tests/qemu-iotests/256 b/tests/qemu-iotests/256 | ||
| 914 | index d7e67f4a05..f34af6cef7 100755 | ||
| 915 | --- a/tests/qemu-iotests/256 | ||
| 916 | +++ b/tests/qemu-iotests/256 | ||
| 917 | @@ -40,25 +40,25 @@ with iotests.FilePath('img0') as img0_path, \ | ||
| 918 | def create_target(filepath, name, size): | ||
| 919 | basename = os.path.basename(filepath) | ||
| 920 | nodename = "file_{}".format(basename) | ||
| 921 | - log(vm.command('blockdev-create', job_id='job1', | ||
| 922 | - options={ | ||
| 923 | - 'driver': 'file', | ||
| 924 | - 'filename': filepath, | ||
| 925 | - 'size': 0, | ||
| 926 | - })) | ||
| 927 | + log(vm.cmd('blockdev-create', job_id='job1', | ||
| 928 | + options={ | ||
| 929 | + 'driver': 'file', | ||
| 930 | + 'filename': filepath, | ||
| 931 | + 'size': 0, | ||
| 932 | + })) | ||
| 933 | vm.run_job('job1') | ||
| 934 | - log(vm.command('blockdev-add', driver='file', | ||
| 935 | - node_name=nodename, filename=filepath)) | ||
| 936 | - log(vm.command('blockdev-create', job_id='job2', | ||
| 937 | - options={ | ||
| 938 | - 'driver': iotests.imgfmt, | ||
| 939 | - 'file': nodename, | ||
| 940 | - 'size': size, | ||
| 941 | - })) | ||
| 942 | + log(vm.cmd('blockdev-add', driver='file', | ||
| 943 | + node_name=nodename, filename=filepath)) | ||
| 944 | + log(vm.cmd('blockdev-create', job_id='job2', | ||
| 945 | + options={ | ||
| 946 | + 'driver': iotests.imgfmt, | ||
| 947 | + 'file': nodename, | ||
| 948 | + 'size': size, | ||
| 949 | + })) | ||
| 950 | vm.run_job('job2') | ||
| 951 | - log(vm.command('blockdev-add', driver=iotests.imgfmt, | ||
| 952 | - node_name=name, | ||
| 953 | - file=nodename)) | ||
| 954 | + log(vm.cmd('blockdev-add', driver=iotests.imgfmt, | ||
| 955 | + node_name=name, | ||
| 956 | + file=nodename)) | ||
| 957 | |||
| 958 | log('--- Preparing images & VM ---\n') | ||
| 959 | vm.add_object('iothread,id=iothread0') | ||
| 960 | diff --git a/tests/qemu-iotests/257 b/tests/qemu-iotests/257 | ||
| 961 | index e7e7a2317e..7d3720b8e5 100755 | ||
| 962 | --- a/tests/qemu-iotests/257 | ||
| 963 | +++ b/tests/qemu-iotests/257 | ||
| 964 | @@ -160,26 +160,26 @@ class Drive: | ||
| 965 | file_node_name = "file_{}".format(basename) | ||
| 966 | vm = self.vm | ||
| 967 | |||
| 968 | - log(vm.command('blockdev-create', job_id='bdc-file-job', | ||
| 969 | - options={ | ||
| 970 | - 'driver': 'file', | ||
| 971 | - 'filename': self.path, | ||
| 972 | - 'size': 0, | ||
| 973 | - })) | ||
| 974 | + log(vm.cmd('blockdev-create', job_id='bdc-file-job', | ||
| 975 | + options={ | ||
| 976 | + 'driver': 'file', | ||
| 977 | + 'filename': self.path, | ||
| 978 | + 'size': 0, | ||
| 979 | + })) | ||
| 980 | vm.run_job('bdc-file-job') | ||
| 981 | - log(vm.command('blockdev-add', driver='file', | ||
| 982 | - node_name=file_node_name, filename=self.path)) | ||
| 983 | - | ||
| 984 | - log(vm.command('blockdev-create', job_id='bdc-fmt-job', | ||
| 985 | - options={ | ||
| 986 | - 'driver': fmt, | ||
| 987 | - 'file': file_node_name, | ||
| 988 | - 'size': size, | ||
| 989 | - })) | ||
| 990 | + log(vm.cmd('blockdev-add', driver='file', | ||
| 991 | + node_name=file_node_name, filename=self.path)) | ||
| 992 | + | ||
| 993 | + log(vm.cmd('blockdev-create', job_id='bdc-fmt-job', | ||
| 994 | + options={ | ||
| 995 | + 'driver': fmt, | ||
| 996 | + 'file': file_node_name, | ||
| 997 | + 'size': size, | ||
| 998 | + })) | ||
| 999 | vm.run_job('bdc-fmt-job') | ||
| 1000 | - log(vm.command('blockdev-add', driver=fmt, | ||
| 1001 | - node_name=name, | ||
| 1002 | - file=file_node_name)) | ||
| 1003 | + log(vm.cmd('blockdev-add', driver=fmt, | ||
| 1004 | + node_name=name, | ||
| 1005 | + file=file_node_name)) | ||
| 1006 | self.fmt = fmt | ||
| 1007 | self.size = size | ||
| 1008 | self.node = name | ||
| 1009 | -- | ||
| 1010 | 2.34.1 | ||
| 1011 | |||
diff --git a/meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx-8.1.inc b/meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx-8.1.inc index f948a8fd..7150fe9e 100644 --- a/meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx-8.1.inc +++ b/meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx-8.1.inc | |||
| @@ -72,6 +72,13 @@ SRC_URI += "\ | |||
| 72 | # Patch doesn't apply to 8.1.0 | 72 | # Patch doesn't apply to 8.1.0 |
| 73 | # file://fixmips.patch | 73 | # file://fixmips.patch |
| 74 | 74 | ||
| 75 | # Additional patches to match Scarthgap, which requires a slightly newer qmp interface | ||
| 76 | SRC_URI += "\ | ||
| 77 | file://0001-python-rename-QEMUMonitorProtocol.cmd-to-cmd_raw.patch \ | ||
| 78 | file://0002-python-qemu-rename-command-to-cmd.patch \ | ||
| 79 | " | ||
| 80 | |||
| 81 | |||
| 75 | S = "${WORKDIR}/git" | 82 | S = "${WORKDIR}/git" |
| 76 | 83 | ||
| 77 | # Based on qemu settings in poky/meta/conf/distro/include/no-static-libs.inc | 84 | # Based on qemu settings in poky/meta/conf/distro/include/no-static-libs.inc |
