diff options
author | Sean Christopherson <seanjc@google.com> | 2022-02-16 09:37:11 -0800 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2022-06-11 11:47:03 -0400 |
commit | 1422efd6bb75e4ae038432449bf9229d6be8e0b4 (patch) | |
tree | 42d25f0421baaeffb98cd65a604b508f83a80a11 /tools/testing/selftests/kvm/x86_64/pmu_event_filter_test.c | |
parent | 9931be3fc62edad381de074ad0db576eefed7fee (diff) |
KVM: selftests: Return created vcpu from vm_vcpu_add_default()
Return the created 'struct kvm_vcpu' object from vm_vcpu_add_default(),
which cleans up a few tests and will eventually allow removing vcpu_get()
entirely.
Opportunistically rename @vcpuid to @vcpu_id to follow preferred kernel
style.
Signed-off-by: Sean Christopherson <seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'tools/testing/selftests/kvm/x86_64/pmu_event_filter_test.c')
-rw-r--r-- | tools/testing/selftests/kvm/x86_64/pmu_event_filter_test.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/tools/testing/selftests/kvm/x86_64/pmu_event_filter_test.c b/tools/testing/selftests/kvm/x86_64/pmu_event_filter_test.c index d2c571f20521..2faa43336131 100644 --- a/tools/testing/selftests/kvm/x86_64/pmu_event_filter_test.c +++ b/tools/testing/selftests/kvm/x86_64/pmu_event_filter_test.c @@ -369,10 +369,8 @@ static void test_pmu_config_disable(void (*guest_code)(void)) vm_enable_cap(vm, KVM_CAP_PMU_CAPABILITY, KVM_PMU_CAP_DISABLE); - vm_vcpu_add_default(vm, 0, guest_code); + vcpu = vm_vcpu_add_default(vm, 0, guest_code); vm_init_descriptor_tables(vm); - - vcpu = vcpu_get(vm, 0); vcpu_init_descriptor_tables(vm, vcpu->id); TEST_ASSERT(!sanity_check_pmu(vcpu), |