diff options
author | Thomas Huth <thuth@redhat.com> | 2019-05-17 11:04:45 +0200 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2019-05-24 21:27:05 +0200 |
commit | 319f6f97e3a16c38795168753db8740f77b156c9 (patch) | |
tree | 3564c1a1f09ab711948d3f44fc1f94ed14174e7f /tools/testing/selftests/kvm/lib/kvm_util.c | |
parent | 3b339e2527a6db257fa8f2a4cab3c510432a98d5 (diff) | |
download | talos-op-linux-319f6f97e3a16c38795168753db8740f77b156c9.tar.gz talos-op-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/lib/kvm_util.c')
-rw-r--r-- | tools/testing/selftests/kvm/lib/kvm_util.c | 3 |
1 files changed, 0 insertions, 3 deletions
diff --git a/tools/testing/selftests/kvm/lib/kvm_util.c b/tools/testing/selftests/kvm/lib/kvm_util.c index e9113857f44e..cf62de377310 100644 --- a/tools/testing/selftests/kvm/lib/kvm_util.c +++ b/tools/testing/selftests/kvm/lib/kvm_util.c @@ -135,7 +135,6 @@ struct kvm_vm *_vm_create(enum vm_guest_mode mode, uint64_t phy_pages, int perm, unsigned long type) { struct kvm_vm *vm; - int kvm_fd; vm = calloc(1, sizeof(*vm)); TEST_ASSERT(vm != NULL, "Insufficient Memory"); @@ -556,7 +555,6 @@ void vm_userspace_mem_region_add(struct kvm_vm *vm, uint32_t flags) { int ret; - unsigned long pmem_size = 0; struct userspace_mem_region *region; size_t huge_page_size = KVM_UTIL_PGS_PER_HUGEPG * vm->page_size; @@ -1334,7 +1332,6 @@ void vcpu_sregs_set(struct kvm_vm *vm, uint32_t vcpuid, struct kvm_sregs *sregs) int _vcpu_sregs_set(struct kvm_vm *vm, uint32_t vcpuid, struct kvm_sregs *sregs) { struct vcpu *vcpu = vcpu_find(vm, vcpuid); - int ret; TEST_ASSERT(vcpu != NULL, "vcpu not found, vcpuid: %u", vcpuid); |