KVM: selftests: Add vcpu_get() to retrieve and assert on vCPU existence
authorSean Christopherson <seanjc@google.com>
Tue, 15 Feb 2022 19:31:16 +0000 (11:31 -0800)
committerPaolo Bonzini <pbonzini@redhat.com>
Sat, 11 Jun 2022 14:18:05 +0000 (10:18 -0400)
commit47a7c924b62de4b9d1752c1f5bc111c847229799
treeb94a4e579fe190cc455bd163c4f85ac6543819e5
parent21c6ee2b3ac25b36cba22a2c725382ff7706dc95
KVM: selftests: Add vcpu_get() to retrieve and assert on vCPU existence

Add vcpu_get() to wrap vcpu_find() and deduplicate a pile of code that
asserts the requested vCPU exists.

Signed-off-by: Sean Christopherson <seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
tools/testing/selftests/kvm/lib/kvm_util.c
tools/testing/selftests/kvm/lib/kvm_util_internal.h
tools/testing/selftests/kvm/lib/s390x/processor.c
tools/testing/selftests/kvm/lib/x86_64/processor.c