summaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/kvm/lib
diff options
context:
space:
mode:
authorThomas Huth <thuth@redhat.com>2019-05-23 18:43:02 +0200
committerChristian Borntraeger <borntraeger@de.ibm.com>2019-06-04 14:05:37 +0200
commita9c788f07347cf5dfcbe4bf77bf0f3a2a04c89f1 (patch)
treea16fd2852fb2447968647e986ce2825d0cc86fa8 /tools/testing/selftests/kvm/lib
parentLinux 5.2-rc3 (diff)
downloadlinux-a9c788f07347cf5dfcbe4bf77bf0f3a2a04c89f1.tar.xz
linux-a9c788f07347cf5dfcbe4bf77bf0f3a2a04c89f1.zip
KVM: selftests: Guard struct kvm_vcpu_events with __KVM_HAVE_VCPU_EVENTS
The struct kvm_vcpu_events code is only available on certain architectures (arm, arm64 and x86). To be able to compile kvm_util.c also for other architectures, we have to fence the code with __KVM_HAVE_VCPU_EVENTS. Reviewed-by: David Hildenbrand <david@redhat.com> Reviewed-by: Andrew Jones <drjones@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com> Message-Id: <20190523164309.13345-3-thuth@redhat.com> Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Diffstat (limited to 'tools/testing/selftests/kvm/lib')
-rw-r--r--tools/testing/selftests/kvm/lib/kvm_util.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/tools/testing/selftests/kvm/lib/kvm_util.c b/tools/testing/selftests/kvm/lib/kvm_util.c
index 633b22df46a4..9ea9ba28af1f 100644
--- a/tools/testing/selftests/kvm/lib/kvm_util.c
+++ b/tools/testing/selftests/kvm/lib/kvm_util.c
@@ -1222,6 +1222,7 @@ void vcpu_regs_set(struct kvm_vm *vm, uint32_t vcpuid, struct kvm_regs *regs)
ret, errno);
}
+#ifdef __KVM_HAVE_VCPU_EVENTS
void vcpu_events_get(struct kvm_vm *vm, uint32_t vcpuid,
struct kvm_vcpu_events *events)
{
@@ -1247,6 +1248,7 @@ void vcpu_events_set(struct kvm_vm *vm, uint32_t vcpuid,
TEST_ASSERT(ret == 0, "KVM_SET_VCPU_EVENTS, failed, rc: %i errno: %i",
ret, errno);
}
+#endif
#ifdef __x86_64__
void vcpu_nested_state_get(struct kvm_vm *vm, uint32_t vcpuid,