Skip to content

Commit

Permalink
KVM: selftests: Fix kvm_check_cap() assertion
Browse files Browse the repository at this point in the history
[ Upstream commit d8ac05e ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
Fuad Tabba authored and Sasha Levin committed Jun 30, 2021
1 parent 4af8575 commit bee7a6e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tools/testing/selftests/kvm/lib/kvm_util.c
Expand Up @@ -58,7 +58,7 @@ int kvm_check_cap(long cap)
exit(KSFT_SKIP);

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);
Expand Down

0 comments on commit bee7a6e

Please sign in to comment.