Skip to content

Commit

Permalink
Merge pull request #3798 from pevogam/faster-vm-cleanup
Browse files Browse the repository at this point in the history
Change vm.destroy gracefulness for performance when discarding vms
  • Loading branch information
luckyh authored Dec 5, 2023
2 parents fb4cab6 + 6f36f8c commit be4af65
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion virttest/env_process.py
Original file line number Diff line number Diff line change
Expand Up @@ -1156,6 +1156,7 @@ def preprocess(test, params, env):
# leave them untouched if they have to be disregarded only for this test
requested_vms = params.objects("vms")
keep_unrequested_vms = params.get_boolean("keep_unrequested_vms", False)
kill_unrequested_vms_gracefully = params.get_boolean("kill_unrequested_vms_gracefully", True)
for key in list(env.keys()):
vm = env[key]
if not isinstance(vm, virt_vm.BaseVM):
Expand All @@ -1165,7 +1166,7 @@ def preprocess(test, params, env):
LOG.debug("The vm %s is registered in the env and disregarded "
"in the current test", vm.name)
else:
vm.destroy()
vm.destroy(gracefully=kill_unrequested_vms_gracefully)
del env[key]

global KVM_MODULE_HANDLERS
Expand Down

0 comments on commit be4af65

Please sign in to comment.