diff mbox series

[v2,041/144] KVM: selftests: Use vm_create_without_vcpus() in hardware_disable_test

Message ID 20220603004331.1523888-42-seanjc@google.com (mailing list archive)
State New, archived
Headers show
Series KVM: selftests: Overhaul APIs, purge VCPU_ID | expand

Commit Message

Sean Christopherson June 3, 2022, 12:41 a.m. UTC
Use vm_create_without_vcpus() instead of open coding a rough equivalent
in hardware_disable_test.

Signed-off-by: Sean Christopherson <seanjc@google.com>
---
 tools/testing/selftests/kvm/hardware_disable_test.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Comments

Andrew Jones June 8, 2022, 2:43 p.m. UTC | #1
On Fri, Jun 03, 2022 at 12:41:48AM +0000, Sean Christopherson wrote:
> Use vm_create_without_vcpus() instead of open coding a rough equivalent
> in hardware_disable_test.
> 
> Signed-off-by: Sean Christopherson <seanjc@google.com>
> ---
>  tools/testing/selftests/kvm/hardware_disable_test.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/tools/testing/selftests/kvm/hardware_disable_test.c b/tools/testing/selftests/kvm/hardware_disable_test.c
> index 81ba8645772a..32837207fe4e 100644
> --- a/tools/testing/selftests/kvm/hardware_disable_test.c
> +++ b/tools/testing/selftests/kvm/hardware_disable_test.c
> @@ -104,9 +104,7 @@ static void run_test(uint32_t run)
>  	for (i = 0; i < VCPU_NUM; i++)
>  		CPU_SET(i, &cpu_set);
>  
> -	vm = vm_create(DEFAULT_GUEST_PHY_PAGES);
> -	kvm_vm_elf_load(vm, program_invocation_name);
> -	vm_create_irqchip(vm);
> +	vm  = vm_create_without_vcpus(VM_MODE_DEFAULT, DEFAULT_GUEST_PHY_PAGES);
nit:       ^ extra space
>  
>  	pr_debug("%s: [%d] start vcpus\n", __func__, run);
>  	for (i = 0; i < VCPU_NUM; ++i) {
> -- 
> 2.36.1.255.ge46751e96f-goog
>
Sean Christopherson June 8, 2022, 7:52 p.m. UTC | #2
On Wed, Jun 08, 2022, Andrew Jones wrote:
> On Fri, Jun 03, 2022 at 12:41:48AM +0000, Sean Christopherson wrote:
> > Use vm_create_without_vcpus() instead of open coding a rough equivalent
> > in hardware_disable_test.
> > 
> > Signed-off-by: Sean Christopherson <seanjc@google.com>
> > ---
> >  tools/testing/selftests/kvm/hardware_disable_test.c | 4 +---
> >  1 file changed, 1 insertion(+), 3 deletions(-)
> > 
> > diff --git a/tools/testing/selftests/kvm/hardware_disable_test.c b/tools/testing/selftests/kvm/hardware_disable_test.c
> > index 81ba8645772a..32837207fe4e 100644
> > --- a/tools/testing/selftests/kvm/hardware_disable_test.c
> > +++ b/tools/testing/selftests/kvm/hardware_disable_test.c
> > @@ -104,9 +104,7 @@ static void run_test(uint32_t run)
> >  	for (i = 0; i < VCPU_NUM; i++)
> >  		CPU_SET(i, &cpu_set);
> >  
> > -	vm = vm_create(DEFAULT_GUEST_PHY_PAGES);
> > -	kvm_vm_elf_load(vm, program_invocation_name);
> > -	vm_create_irqchip(vm);
> > +	vm  = vm_create_without_vcpus(VM_MODE_DEFAULT, DEFAULT_GUEST_PHY_PAGES);
> nit:       ^ extra space

Heh, and I managed to carry that to the end of the series.  At least I'm consistent?
diff mbox series

Patch

diff --git a/tools/testing/selftests/kvm/hardware_disable_test.c b/tools/testing/selftests/kvm/hardware_disable_test.c
index 81ba8645772a..32837207fe4e 100644
--- a/tools/testing/selftests/kvm/hardware_disable_test.c
+++ b/tools/testing/selftests/kvm/hardware_disable_test.c
@@ -104,9 +104,7 @@  static void run_test(uint32_t run)
 	for (i = 0; i < VCPU_NUM; i++)
 		CPU_SET(i, &cpu_set);
 
-	vm = vm_create(DEFAULT_GUEST_PHY_PAGES);
-	kvm_vm_elf_load(vm, program_invocation_name);
-	vm_create_irqchip(vm);
+	vm  = vm_create_without_vcpus(VM_MODE_DEFAULT, DEFAULT_GUEST_PHY_PAGES);
 
 	pr_debug("%s: [%d] start vcpus\n", __func__, run);
 	for (i = 0; i < VCPU_NUM; ++i) {