KVM: selftests: Consolidate KVM_ENABLE_CAP usage
authorSean Christopherson <seanjc@google.com>
Thu, 2 Jun 2022 19:55:59 +0000 (12:55 -0700)
committerPaolo Bonzini <pbonzini@redhat.com>
Sat, 11 Jun 2022 15:46:25 +0000 (11:46 -0400)
commitac71220934a9240864ec485932308866500b1e61
tree1180c6b0ea192ae31ec5fc768371361ced5f14f4
parentc472df1ac318c1120f32cd4a70d202806be30c43
KVM: selftests: Consolidate KVM_ENABLE_CAP usage

Add __vm_enable_cap() and use it for negative tests that expect
KVM_ENABLE_CAP to fail.  Opportunistically clean up the MAX_VCPU_ID test
error messages.

Signed-off-by: Sean Christopherson <seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
tools/testing/selftests/kvm/include/kvm_util_base.h
tools/testing/selftests/kvm/lib/x86_64/vmx.c
tools/testing/selftests/kvm/x86_64/max_vcpuid_cap_test.c
tools/testing/selftests/kvm/x86_64/sev_migrate_tests.c