Skip to content

Commit

Permalink
env_process: relocate migrate vm registration
Browse files Browse the repository at this point in the history
In the preprocess routine from env_process a piece of code is in charge
of registering the "migrate_vms" into the "vm" configuration parameter.
Some of the environment preprocessing steps might need from that
configuration to work properly. However, due to the ongoing refactoring
of the env_process:{pre,post}process functions, the migrate_vms might be
registered after the environment setup step. This will probably make
some of the setup steps misbehave.

For that reason, let's move the migrate_vm registration step to the
beginning of the preprocess function.

Signed-off-by: Beñat Gartzia Arruabarrena <bgartzia@redhat.com>
  • Loading branch information
bgartzi committed Jun 6, 2024
1 parent f300598 commit 1f84873
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions virttest/env_process.py
Original file line number Diff line number Diff line change
Expand Up @@ -1003,6 +1003,12 @@ def preprocess(test, params, env):
if callable(preprocess_vm_off_hook):
preprocess_vm_off_hook(test, params, env) # pylint: disable=E1102

# Add migrate_vms to vms
migrate_vms = params.objects("migrate_vms")
if migrate_vms:
vms = list(set(params.objects("vms") + migrate_vms))
params["vms"] = " ".join(vms)

# Check if code coverage for qemu is enabled and
# if coverage reset is enabled too, reset coverage report
gcov_qemu = params.get("gcov_qemu", "no") == "yes"
Expand Down Expand Up @@ -1102,12 +1108,6 @@ def preprocess(test, params, env):

base_dir = data_dir.get_data_dir()

# Add migrate_vms to vms
migrate_vms = params.objects("migrate_vms")
if migrate_vms:
vms = list(set(params.objects("vms") + migrate_vms))
params["vms"] = " ".join(vms)

# Permit iptables to permit 49152-49216 ports to libvirt for
# migration and if arch is ppc with power8 then switch off smt
# will be taken care in remote machine for migration to succeed
Expand Down

0 comments on commit 1f84873

Please sign in to comment.