Skip to content

Commit

Permalink
selftests: kvm: Simplify loop in kvm_create_max_vcpus test
Browse files Browse the repository at this point in the history
On kvm_create_max_vcpus test remove unneeded local
variable in the loop that add vcpus to the VM.

Signed-off-by: Wainer dos Santos Moschetta <[email protected]>
Reviewed-by: Krish Sadhukhan <[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
  • Loading branch information
wainersm authored and bonzini committed Nov 15, 2019
1 parent 1924242 commit f245eea
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions tools/testing/selftests/kvm/kvm_create_max_vcpus.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,9 @@ void test_vcpu_creation(int first_vcpu_id, int num_vcpus)

vm = vm_create(VM_MODE_DEFAULT, DEFAULT_GUEST_PHY_PAGES, O_RDWR);

for (i = 0; i < num_vcpus; i++) {
int vcpu_id = first_vcpu_id + i;

for (i = first_vcpu_id; i < first_vcpu_id + num_vcpus; i++)
/* This asserts that the vCPU was created. */
vm_vcpu_add(vm, vcpu_id);
}
vm_vcpu_add(vm, i);

kvm_vm_free(vm);
}
Expand Down

0 comments on commit f245eea

Please sign in to comment.