Skip to content

Commit

Permalink
Add timeout to retry until vcpu hotplug check fails
Browse files Browse the repository at this point in the history
Add timeout to retry until vcpu hotplug check fails, as
time to complete hotplug event increases with number of
vcpus increases and the check can be wrong, so let's confirm
it for retrying until a timeout.

Signed-off-by: Satheesh Rajendran <[email protected]>
  • Loading branch information
Satheesh Rajendran committed Jan 3, 2020
1 parent 99ad56f commit f9489e7
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion virttest/cpu.py
Original file line number Diff line number Diff line change
Expand Up @@ -513,8 +513,11 @@ def check_vcpu_value(vm, exp_vcpu, vcpupin=None, option="", guest_agent=False):
final_result = False

if vm.is_alive() and (not vm.is_paused()) and "live" in option:
vcpu_hotplug_timeout = 120 # maximum time to wait for a hotplug event to complete
# 1.5 Check inside the guest
if not check_if_vm_vcpu_match(exp_vcpu['guest_live'], vm):
if not utils_misc.wait_for(lambda: check_if_vm_vcpu_match(exp_vcpu['guest_live'],
vm),
vcpu_hotplug_timeout, text="wait for vcpu online"):
final_result = False
# 1.6 Check guest numa
if not guest_numa_check(vm, exp_vcpu):
Expand Down

0 comments on commit f9489e7

Please sign in to comment.