mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-09 02:24:58 -06:00
python/qemu: rename command() to cmd()
Use a shorter name. We are going to move in iotests from qmp() to command() where possible. But command() is longer than qmp() and don't look better. Let's rename. You can simply grep for '\.command(' and for 'def command(' to check that everything is updated (command() in tests/docker/docker.py is unrelated). Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Cédric Le Goater <clg@kaod.org> Reviewed-by: Juan Quintela <quintela@redhat.com> Message-id: 20231006154125.1068348-6-vsementsov@yandex-team.ru [vsementsov: also update three occurrences in tests/avocado/machine_aspeed.py and keep r-b] Signed-off-by: John Snow <jsnow@redhat.com>
This commit is contained in:
parent
37274707f6
commit
684750ab4f
29 changed files with 200 additions and 195 deletions
|
@ -77,7 +77,7 @@ class Engine(object):
|
|||
return TimingRecord(pid, now, 1000 * (stime + utime) / jiffies_per_sec)
|
||||
|
||||
def _migrate_progress(self, vm):
|
||||
info = vm.command("query-migrate")
|
||||
info = vm.cmd("query-migrate")
|
||||
|
||||
if "ram" not in info:
|
||||
info["ram"] = {}
|
||||
|
@ -109,7 +109,7 @@ class Engine(object):
|
|||
src_vcpu_time = []
|
||||
src_pid = src.get_pid()
|
||||
|
||||
vcpus = src.command("query-cpus-fast")
|
||||
vcpus = src.cmd("query-cpus-fast")
|
||||
src_threads = []
|
||||
for vcpu in vcpus:
|
||||
src_threads.append(vcpu["thread-id"])
|
||||
|
@ -128,82 +128,82 @@ class Engine(object):
|
|||
if self._verbose:
|
||||
print("Starting migration")
|
||||
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:
|
||||
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.cmd("migrate-set-capabilities",
|
||||
capabilities = [
|
||||
{ "capability": "postcopy-ram",
|
||||
"state": True }
|
||||
])
|
||||
resp = dst.cmd("migrate-set-capabilities",
|
||||
capabilities = [
|
||||
{ "capability": "postcopy-ram",
|
||||
"state": True }
|
||||
])
|
||||
|
||||
resp = src.command("migrate-set-parameters",
|
||||
max_bandwidth=scenario._bandwidth * 1024 * 1024)
|
||||
resp = src.cmd("migrate-set-parameters",
|
||||
max_bandwidth=scenario._bandwidth * 1024 * 1024)
|
||||
|
||||
resp = src.command("migrate-set-parameters",
|
||||
downtime_limit=scenario._downtime)
|
||||
resp = src.cmd("migrate-set-parameters",
|
||||
downtime_limit=scenario._downtime)
|
||||
|
||||
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:
|
||||
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:
|
||||
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.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.command("migrate", uri=connect_uri)
|
||||
resp = src.cmd("migrate", uri=connect_uri)
|
||||
|
||||
post_copy = False
|
||||
paused = False
|
||||
|
@ -228,7 +228,7 @@ class Engine(object):
|
|||
|
||||
if progress._status in ("completed", "failed", "cancelled"):
|
||||
if progress._status == "completed" and paused:
|
||||
dst.command("cont")
|
||||
dst.cmd("cont")
|
||||
if progress_history[-1] != progress:
|
||||
progress_history.append(progress)
|
||||
|
||||
|
@ -256,13 +256,13 @@ class Engine(object):
|
|||
if progress._ram._iterations > scenario._max_iters:
|
||||
if self._verbose:
|
||||
print("No completion after %d iterations over RAM" % scenario._max_iters)
|
||||
src.command("migrate_cancel")
|
||||
src.cmd("migrate_cancel")
|
||||
continue
|
||||
|
||||
if time.time() > (start + scenario._max_time):
|
||||
if self._verbose:
|
||||
print("No completion after %d seconds" % scenario._max_time)
|
||||
src.command("migrate_cancel")
|
||||
src.cmd("migrate_cancel")
|
||||
continue
|
||||
|
||||
if (scenario._post_copy and
|
||||
|
@ -270,7 +270,7 @@ class Engine(object):
|
|||
not post_copy):
|
||||
if self._verbose:
|
||||
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
|
||||
|
||||
if (scenario._pause and
|
||||
|
@ -278,7 +278,7 @@ class Engine(object):
|
|||
not paused):
|
||||
if self._verbose:
|
||||
print("Pausing VM after %d iterations" % scenario._pause_iters)
|
||||
resp = src.command("stop")
|
||||
resp = src.cmd("stop")
|
||||
paused = True
|
||||
|
||||
def _is_ppc64le(self):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue