diff options
author | Thomas Huth <thuth@redhat.com> | 2019-05-23 05:31:14 -0400 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2019-05-24 15:27:17 -0400 |
commit | c795720629ae1bfcbaef7a934a4cc1ce8c2e2834 (patch) | |
tree | beffa4cf2b1fd0c3c1f87b20bea9bad2464ce8f0 | |
parent | 98e683443ba298685205c0c5157df49e42c1c0b1 (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.h | 2 | ||||
-rw-r--r-- | tools/testing/selftests/kvm/lib/kvm_util.c | 2 |
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); |
119 | void vcpu_events_set(struct kvm_vm *vm, uint32_t vcpuid, | 119 | void 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__ | ||
121 | void vcpu_nested_state_get(struct kvm_vm *vm, uint32_t vcpuid, | 122 | void vcpu_nested_state_get(struct kvm_vm *vm, uint32_t vcpuid, |
122 | struct kvm_nested_state *state); | 123 | struct kvm_nested_state *state); |
123 | int vcpu_nested_state_set(struct kvm_vm *vm, uint32_t vcpuid, | 124 | int 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 | ||
126 | const char *exit_reason_str(unsigned int exit_reason); | 128 | const 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__ | ||
1251 | void vcpu_nested_state_get(struct kvm_vm *vm, uint32_t vcpuid, | 1252 | void 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 |