diff options
author | Thomas Huth | 2019-05-17 11:04:45 +0200 |
---|---|---|
committer | Paolo Bonzini | 2019-05-24 21:27:05 +0200 |
commit | 319f6f97e3a16c38795168753db8740f77b156c9 (patch) | |
tree | 3564c1a1f09ab711948d3f44fc1f94ed14174e7f /tools/testing/selftests/kvm/x86_64/state_test.c | |
parent | kvm: selftests: avoid type punning (diff) | |
download | kernel-qcow2-linux-319f6f97e3a16c38795168753db8740f77b156c9.tar.gz kernel-qcow2-linux-319f6f97e3a16c38795168753db8740f77b156c9.tar.xz kernel-qcow2-linux-319f6f97e3a16c38795168753db8740f77b156c9.zip |
KVM: selftests: Compile code with warnings enabled
So far the KVM selftests are compiled without any compiler warnings
enabled. That's quite bad, since we miss a lot of possible bugs this
way. Let's enable at least "-Wall" and some other useful warning flags
now, and fix at least the trivial problems in the code (like unused
variables).
Signed-off-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'tools/testing/selftests/kvm/x86_64/state_test.c')
-rw-r--r-- | tools/testing/selftests/kvm/x86_64/state_test.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/tools/testing/selftests/kvm/x86_64/state_test.c b/tools/testing/selftests/kvm/x86_64/state_test.c index e0a3c0204b7c..2a4121f4de01 100644 --- a/tools/testing/selftests/kvm/x86_64/state_test.c +++ b/tools/testing/selftests/kvm/x86_64/state_test.c @@ -22,8 +22,6 @@ #define VCPU_ID 5 -static bool have_nested_state; - void l2_guest_code(void) { GUEST_SYNC(6); @@ -122,7 +120,6 @@ void guest_code(struct vmx_pages *vmx_pages) int main(int argc, char *argv[]) { - struct vmx_pages *vmx_pages = NULL; vm_vaddr_t vmx_pages_gva = 0; struct kvm_regs regs1, regs2; @@ -132,8 +129,6 @@ int main(int argc, char *argv[]) struct ucall uc; int stage; - struct kvm_cpuid_entry2 *entry = kvm_get_supported_cpuid_entry(1); - /* Create VM */ vm = vm_create_default(VCPU_ID, 0, guest_code); vcpu_set_cpuid(vm, VCPU_ID, kvm_get_supported_cpuid()); @@ -142,7 +137,7 @@ int main(int argc, char *argv[]) vcpu_regs_get(vm, VCPU_ID, ®s1); if (kvm_check_cap(KVM_CAP_NESTED_STATE)) { - vmx_pages = vcpu_alloc_vmx(vm, &vmx_pages_gva); + vcpu_alloc_vmx(vm, &vmx_pages_gva); vcpu_args_set(vm, VCPU_ID, 1, vmx_pages_gva); } else { printf("will skip nested state checks\n"); |