aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Huth <thuth@redhat.com>2019-05-23 05:31:14 -0400
committerPaolo Bonzini <pbonzini@redhat.com>2019-05-24 15:27:17 -0400
commitc795720629ae1bfcbaef7a934a4cc1ce8c2e2834 (patch)
treebeffa4cf2b1fd0c3c1f87b20bea9bad2464ce8f0
parent98e683443ba298685205c0c5157df49e42c1c0b1 (diff)
KVM: selftests: Wrap vcpu_nested_state_get/set functions with x86 guard
struct kvm_nested_state is only available on x86 so far. To be able to compile the code on other architectures as well, we need to wrap the related code with #ifdefs. Signed-off-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
-rw-r--r--tools/testing/selftests/kvm/include/kvm_util.h2
-rw-r--r--tools/testing/selftests/kvm/lib/kvm_util.c2
2 files changed, 4 insertions, 0 deletions
diff --git a/tools/testing/selftests/kvm/include/kvm_util.h b/tools/testing/selftests/kvm/include/kvm_util.h
index 8c6b9619797d..a5a4b28f14d8 100644
--- a/tools/testing/selftests/kvm/include/kvm_util.h
+++ b/tools/testing/selftests/kvm/include/kvm_util.h
@@ -118,10 +118,12 @@ void vcpu_events_get(struct kvm_vm *vm, uint32_t vcpuid,
118 struct kvm_vcpu_events *events); 118 struct kvm_vcpu_events *events);
119void vcpu_events_set(struct kvm_vm *vm, uint32_t vcpuid, 119void vcpu_events_set(struct kvm_vm *vm, uint32_t vcpuid,
120 struct kvm_vcpu_events *events); 120 struct kvm_vcpu_events *events);
121#ifdef __x86_64__
121void vcpu_nested_state_get(struct kvm_vm *vm, uint32_t vcpuid, 122void vcpu_nested_state_get(struct kvm_vm *vm, uint32_t vcpuid,
122 struct kvm_nested_state *state); 123 struct kvm_nested_state *state);
123int vcpu_nested_state_set(struct kvm_vm *vm, uint32_t vcpuid, 124int vcpu_nested_state_set(struct kvm_vm *vm, uint32_t vcpuid,
124 struct kvm_nested_state *state, bool ignore_error); 125 struct kvm_nested_state *state, bool ignore_error);
126#endif
125 127
126const char *exit_reason_str(unsigned int exit_reason); 128const char *exit_reason_str(unsigned int exit_reason);
127 129
diff --git a/tools/testing/selftests/kvm/lib/kvm_util.c b/tools/testing/selftests/kvm/lib/kvm_util.c
index cf62de377310..633b22df46a4 100644
--- a/tools/testing/selftests/kvm/lib/kvm_util.c
+++ b/tools/testing/selftests/kvm/lib/kvm_util.c
@@ -1248,6 +1248,7 @@ void vcpu_events_set(struct kvm_vm *vm, uint32_t vcpuid,
1248 ret, errno); 1248 ret, errno);
1249} 1249}
1250 1250
1251#ifdef __x86_64__
1251void vcpu_nested_state_get(struct kvm_vm *vm, uint32_t vcpuid, 1252void vcpu_nested_state_get(struct kvm_vm *vm, uint32_t vcpuid,
1252 struct kvm_nested_state *state) 1253 struct kvm_nested_state *state)
1253{ 1254{
@@ -1279,6 +1280,7 @@ int vcpu_nested_state_set(struct kvm_vm *vm, uint32_t vcpuid,
1279 1280
1280 return ret; 1281 return ret;
1281} 1282}
1283#endif
1282 1284
1283/* 1285/*
1284 * VM VCPU System Regs Get 1286 * VM VCPU System Regs Get