summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorFuad Tabba <tabba@google.com>2021-06-15 16:04:43 +0100
committerPaolo Bonzini <pbonzini@redhat.com>2021-06-17 13:06:57 -0400
commitd8ac05ea13d789d5491a5920d70a05659015441d (patch)
tree4d39c70d56270a4740643ec80f020ac5924a50a1 /tools
parent654430efde27248be563df9a88631204b5fe2df2 (diff)
downloadlinux-d8ac05ea13d789d5491a5920d70a05659015441d.tar.gz
linux-d8ac05ea13d789d5491a5920d70a05659015441d.tar.bz2
linux-d8ac05ea13d789d5491a5920d70a05659015441d.zip
KVM: selftests: Fix kvm_check_cap() assertion
KVM_CHECK_EXTENSION ioctl can return any negative value on error, and not necessarily -1. Change the assertion to reflect that. Signed-off-by: Fuad Tabba <tabba@google.com> Message-Id: <20210615150443.1183365-1-tabba@google.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/testing/selftests/kvm/lib/kvm_util.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/testing/selftests/kvm/lib/kvm_util.c b/tools/testing/selftests/kvm/lib/kvm_util.c
index 5c70596dd1b9..a2b732cf96ea 100644
--- a/tools/testing/selftests/kvm/lib/kvm_util.c
+++ b/tools/testing/selftests/kvm/lib/kvm_util.c
@@ -82,7 +82,7 @@ int kvm_check_cap(long cap)
kvm_fd = open_kvm_dev_path_or_exit();
ret = ioctl(kvm_fd, KVM_CHECK_EXTENSION, cap);
- TEST_ASSERT(ret != -1, "KVM_CHECK_EXTENSION IOCTL failed,\n"
+ TEST_ASSERT(ret >= 0, "KVM_CHECK_EXTENSION IOCTL failed,\n"
" rc: %i errno: %i", ret, errno);
close(kvm_fd);