aboutsummaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/kvm/aarch64
diff options
context:
space:
mode:
authorSean Christopherson <seanjc@google.com>2022-02-17 12:16:20 -0800
committerPaolo Bonzini <pbonzini@redhat.com>2022-06-11 11:46:21 -0400
commit98f94ce42ac672b2abdcf38cfc0e60fd52e04995 (patch)
tree4e3ee8c2a404869ca09821616135fc29dd81e23b /tools/testing/selftests/kvm/aarch64
parentKVM: selftests: Drop @test param from kvm_create_device() (diff)
downloadlinux-dev-98f94ce42ac672b2abdcf38cfc0e60fd52e04995.tar.xz
linux-dev-98f94ce42ac672b2abdcf38cfc0e60fd52e04995.zip
KVM: selftests: Move KVM_CREATE_DEVICE_TEST code to separate helper
Move KVM_CREATE_DEVICE_TEST to its own helper, identifying "real" versus "test" device creation based on a hardcoded boolean buried in the middle of a param list is painful for readers. Signed-off-by: Sean Christopherson <seanjc@google.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'tools/testing/selftests/kvm/aarch64')
-rw-r--r--tools/testing/selftests/kvm/aarch64/vgic_init.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/tools/testing/selftests/kvm/aarch64/vgic_init.c b/tools/testing/selftests/kvm/aarch64/vgic_init.c
index 4928cb43c8a7..18054b94207f 100644
--- a/tools/testing/selftests/kvm/aarch64/vgic_init.c
+++ b/tools/testing/selftests/kvm/aarch64/vgic_init.c
@@ -649,24 +649,24 @@ int test_kvm_device(uint32_t gic_dev_type)
v.vm = vm_create_default_with_vcpus(NR_VCPUS, 0, 0, guest_code, NULL);
/* try to create a non existing KVM device */
- ret = _kvm_create_device(v.vm, 0, true, &fd);
+ ret = __kvm_test_create_device(v.vm, 0);
TEST_ASSERT(ret && errno == ENODEV, "unsupported device");
/* trial mode */
- ret = _kvm_create_device(v.vm, gic_dev_type, true, &fd);
+ ret = __kvm_test_create_device(v.vm, gic_dev_type);
if (ret)
return ret;
v.gic_fd = kvm_create_device(v.vm, gic_dev_type);
- ret = _kvm_create_device(v.vm, gic_dev_type, false, &fd);
+ ret = __kvm_create_device(v.vm, gic_dev_type, &fd);
TEST_ASSERT(ret && errno == EEXIST, "create GIC device twice");
/* try to create the other gic_dev_type */
other = VGIC_DEV_IS_V2(gic_dev_type) ? KVM_DEV_TYPE_ARM_VGIC_V3
: KVM_DEV_TYPE_ARM_VGIC_V2;
- if (!_kvm_create_device(v.vm, other, true, &fd)) {
- ret = _kvm_create_device(v.vm, other, false, &fd);
+ if (!__kvm_test_create_device(v.vm, other)) {
+ ret = __kvm_test_create_device(v.vm, other);
TEST_ASSERT(ret && errno == EINVAL,
"create GIC device while other version exists");
}