aboutsummaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/kvm/lib
diff options
context:
space:
mode:
authorSean Christopherson <seanjc@google.com>2022-02-17 12:09:28 -0800
committerPaolo Bonzini <pbonzini@redhat.com>2022-06-11 11:46:20 -0400
commitf3165dc02212e8eaf5cb675f105aac89c6de431c (patch)
treef6b4ef6e9da0e7b3da4bed2f358f986a13764a6d /tools/testing/selftests/kvm/lib
parentKVM: selftests: Use KVM_IOCTL_ERROR() for one-off arm64 ioctls (diff)
downloadlinux-dev-f3165dc02212e8eaf5cb675f105aac89c6de431c.tar.xz
linux-dev-f3165dc02212e8eaf5cb675f105aac89c6de431c.zip
KVM: selftests: Drop @test param from kvm_create_device()
Remove the two calls that pass @test=true to kvm_create_device() and drop the @test param entirely. The two removed calls don't check the return value of kvm_create_device(), so other than verifying KVM doesn't explode, which is extremely unlikely given that the non-test variant was _just_ called, they are pointless and provide no validation coverage. Signed-off-by: Sean Christopherson <seanjc@google.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'tools/testing/selftests/kvm/lib')
-rw-r--r--tools/testing/selftests/kvm/lib/kvm_util.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/tools/testing/selftests/kvm/lib/kvm_util.c b/tools/testing/selftests/kvm/lib/kvm_util.c
index a57958a39c1b..cb2e42aa1c03 100644
--- a/tools/testing/selftests/kvm/lib/kvm_util.c
+++ b/tools/testing/selftests/kvm/lib/kvm_util.c
@@ -1642,18 +1642,14 @@ int _kvm_create_device(struct kvm_vm *vm, uint64_t type, bool test, int *fd)
return ret;
}
-int kvm_create_device(struct kvm_vm *vm, uint64_t type, bool test)
+int kvm_create_device(struct kvm_vm *vm, uint64_t type)
{
int fd, ret;
- ret = _kvm_create_device(vm, type, test, &fd);
+ ret = _kvm_create_device(vm, type, false, &fd);
- if (!test) {
- TEST_ASSERT(!ret,
- "KVM_CREATE_DEVICE IOCTL failed, rc: %i errno: %i", ret, errno);
- return fd;
- }
- return ret;
+ TEST_ASSERT(!ret, "KVM_CREATE_DEVICE IOCTL failed, rc: %i errno: %i", ret, errno);
+ return fd;
}
int _kvm_device_access(int dev_fd, uint32_t group, uint64_t attr,