summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/kvm/x86_64/kvm_pv_test.c
diff options
context:
space:
mode:
authorSean Christopherson <seanjc@google.com>2022-05-28 01:13:03 +0300
committerPaolo Bonzini <pbonzini@redhat.com>2022-06-11 18:47:28 +0300
commit3ea9b809650b4eda5d4ae18ed7bb080e499af154 (patch)
tree69a88487730d38d154c7e7fea7af84973b8ac713 /tools/testing/selftests/kvm/x86_64/kvm_pv_test.c
parentd8ba3f14a50e4bc9745bb8f66a599c6be8ad0cda (diff)
downloadlinux-3ea9b809650b4eda5d4ae18ed7bb080e499af154.tar.xz
KVM: selftests: Add kvm_has_cap() to provide syntactic sugar
Add kvm_has_cap() to wrap kvm_check_cap() and return a bool for the use cases where the caller only wants check if a capability is supported, i.e. doesn't care about the value beyond whether or not it's non-zero. The "check" terminology is somewhat ambiguous as the non-boolean return suggests that '0' might mean "success", i.e. suggests that the ioctl uses the 0/-errno pattern. Provide a wrapper instead of trying to find a new name for the raw helper; the "check" terminology is derived from the name of the ioctl, so using e.g. "get" isn't a clear win. 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/kvm_pv_test.c')
-rw-r--r--tools/testing/selftests/kvm/x86_64/kvm_pv_test.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/testing/selftests/kvm/x86_64/kvm_pv_test.c b/tools/testing/selftests/kvm/x86_64/kvm_pv_test.c
index f497d6ecec25..24dad3a47206 100644
--- a/tools/testing/selftests/kvm/x86_64/kvm_pv_test.c
+++ b/tools/testing/selftests/kvm/x86_64/kvm_pv_test.c
@@ -204,7 +204,7 @@ int main(void)
struct kvm_vcpu *vcpu;
struct kvm_vm *vm;
- if (!kvm_check_cap(KVM_CAP_ENFORCE_PV_FEATURE_CPUID)) {
+ if (!kvm_has_cap(KVM_CAP_ENFORCE_PV_FEATURE_CPUID)) {
print_skip("KVM_CAP_ENFORCE_PV_FEATURE_CPUID not supported");
exit(KSFT_SKIP);
}