* [PATCH] selftests: kvm: Simplify loop in kvm_create_max_vcpus test
@ 2019-11-12 14:21 Wainer dos Santos Moschetta
2019-11-14 0:39 ` Krish Sadhukhan
2019-11-14 12:16 ` Paolo Bonzini
0 siblings, 2 replies; 3+ messages in thread
From: Wainer dos Santos Moschetta @ 2019-11-12 14:21 UTC (permalink / raw)
To: pbonzini, rkrcmar; +Cc: shuah, kvm, linux-kselftest, linux-kernel
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 <wainersm@redhat.com>
---
tools/testing/selftests/kvm/kvm_create_max_vcpus.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/tools/testing/selftests/kvm/kvm_create_max_vcpus.c b/tools/testing/selftests/kvm/kvm_create_max_vcpus.c
index 231d79e57774..6f38c3dc0d56 100644
--- a/tools/testing/selftests/kvm/kvm_create_max_vcpus.c
+++ b/tools/testing/selftests/kvm/kvm_create_max_vcpus.c
@@ -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);
}
--
2.18.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] selftests: kvm: Simplify loop in kvm_create_max_vcpus test
2019-11-12 14:21 [PATCH] selftests: kvm: Simplify loop in kvm_create_max_vcpus test Wainer dos Santos Moschetta
@ 2019-11-14 0:39 ` Krish Sadhukhan
2019-11-14 12:16 ` Paolo Bonzini
1 sibling, 0 replies; 3+ messages in thread
From: Krish Sadhukhan @ 2019-11-14 0:39 UTC (permalink / raw)
To: Wainer dos Santos Moschetta, pbonzini, rkrcmar
Cc: shuah, kvm, linux-kselftest, linux-kernel
On 11/12/19 6:21 AM, Wainer dos Santos Moschetta wrote:
> 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<wainersm@redhat.com>
> ---
> tools/testing/selftests/kvm/kvm_create_max_vcpus.c | 7 ++-----
> 1 file changed, 2 insertions(+), 5 deletions(-)
>
> diff --git a/tools/testing/selftests/kvm/kvm_create_max_vcpus.c b/tools/testing/selftests/kvm/kvm_create_max_vcpus.c
> index 231d79e57774..6f38c3dc0d56 100644
> --- a/tools/testing/selftests/kvm/kvm_create_max_vcpus.c
> +++ b/tools/testing/selftests/kvm/kvm_create_max_vcpus.c
> @@ -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);
> }
Reviewed-by: Krish Sadhukhan <krish.sadhukhan@oracle.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] selftests: kvm: Simplify loop in kvm_create_max_vcpus test
2019-11-12 14:21 [PATCH] selftests: kvm: Simplify loop in kvm_create_max_vcpus test Wainer dos Santos Moschetta
2019-11-14 0:39 ` Krish Sadhukhan
@ 2019-11-14 12:16 ` Paolo Bonzini
1 sibling, 0 replies; 3+ messages in thread
From: Paolo Bonzini @ 2019-11-14 12:16 UTC (permalink / raw)
To: Wainer dos Santos Moschetta, rkrcmar
Cc: shuah, kvm, linux-kselftest, linux-kernel
On 12/11/19 15:21, Wainer dos Santos Moschetta wrote:
> 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 <wainersm@redhat.com>
> ---
> tools/testing/selftests/kvm/kvm_create_max_vcpus.c | 7 ++-----
> 1 file changed, 2 insertions(+), 5 deletions(-)
>
> diff --git a/tools/testing/selftests/kvm/kvm_create_max_vcpus.c b/tools/testing/selftests/kvm/kvm_create_max_vcpus.c
> index 231d79e57774..6f38c3dc0d56 100644
> --- a/tools/testing/selftests/kvm/kvm_create_max_vcpus.c
> +++ b/tools/testing/selftests/kvm/kvm_create_max_vcpus.c
> @@ -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);
> }
>
Queued, thanks.
Paolo
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-11-14 12:16 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-12 14:21 [PATCH] selftests: kvm: Simplify loop in kvm_create_max_vcpus test Wainer dos Santos Moschetta
2019-11-14 0:39 ` Krish Sadhukhan
2019-11-14 12:16 ` Paolo Bonzini
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).