aboutsummaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/kvm/vmx_tsc_adjust_test.c
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2018-04-18 18:26:45 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2018-05-11 11:21:12 +0200
commitbcb2b94ae01009db26d1ad0811975405149b14f0 (patch)
treeeb09c4e4e82c2b56e0fc1ba02818b0245a4a420e /tools/testing/selftests/kvm/vmx_tsc_adjust_test.c
parentKVM: hyperv: idr_find needs RCU protection (diff)
downloadlinux-dev-bcb2b94ae01009db26d1ad0811975405149b14f0.tar.xz
linux-dev-bcb2b94ae01009db26d1ad0811975405149b14f0.zip
KVM: selftests: exit with 0 status code when tests cannot be run
Right now, skipped tests are returning a failure exit code if /dev/kvm does not exists. Consistently return a zero status code so that various scripts over the interwebs do not complain. Also return a zero status code if the KVM_CAP_SYNC_REGS capability is not present, and hardcode in the test the register kinds that are covered (rather than just using whatever value of KVM_SYNC_X86_VALID_FIELDS is provided by the kernel headers). Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to '')
-rw-r--r--tools/testing/selftests/kvm/vmx_tsc_adjust_test.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/testing/selftests/kvm/vmx_tsc_adjust_test.c b/tools/testing/selftests/kvm/vmx_tsc_adjust_test.c
index 8f7f62093add..aaa633263b2c 100644
--- a/tools/testing/selftests/kvm/vmx_tsc_adjust_test.c
+++ b/tools/testing/selftests/kvm/vmx_tsc_adjust_test.c
@@ -189,8 +189,8 @@ int main(int argc, char *argv[])
struct kvm_cpuid_entry2 *entry = kvm_get_supported_cpuid_entry(1);
if (!(entry->ecx & CPUID_VMX)) {
- printf("nested VMX not enabled, skipping test");
- return 0;
+ fprintf(stderr, "nested VMX not enabled, skipping test\n");
+ exit(KSFT_SKIP);
}
vm = vm_create_default_vmx(VCPU_ID, (void *) l1_guest_code);