linux/tools/testing/selftests/kvm/include
Peter Xu 8ffdaf9155 KVM: selftests: Fix build for evmcs.h
I got this error when building kvm selftests:

/usr/bin/ld: /home/xz/git/linux/tools/testing/selftests/kvm/libkvm.a(vmx.o):/home/xz/git/linux/tools/testing/selftests/kvm/include/evmcs.h:222: multiple definition of `current_evmcs'; /tmp/cco1G48P.o:/home/xz/git/linux/tools/testing/selftests/kvm/include/evmcs.h:222: first defined here
/usr/bin/ld: /home/xz/git/linux/tools/testing/selftests/kvm/libkvm.a(vmx.o):/home/xz/git/linux/tools/testing/selftests/kvm/include/evmcs.h:223: multiple definition of `current_vp_assist'; /tmp/cco1G48P.o:/home/xz/git/linux/tools/testing/selftests/kvm/include/evmcs.h:223: first defined here

I think it's because evmcs.h is included both in a test file and a lib file so
the structs have multiple declarations when linking.  After all it's not a good
habit to declare structs in the header files.

Cc: Vitaly Kuznetsov <vkuznets@redhat.com>
Signed-off-by: Peter Xu <peterx@redhat.com>
Message-Id: <20200504220607.99627-1-peterx@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2020-05-06 06:51:36 -04:00
..
aarch64 kvm: selftests: introduce aarch64_vcpu_add_default 2019-06-05 14:14:45 +02:00
s390x KVM: selftests: Add processor code for s390x 2019-06-04 14:05:38 +02:00
x86_64 selftests: KVM: Remove unused x86_register enum 2020-02-12 20:09:45 +01:00
evmcs.h KVM: selftests: Fix build for evmcs.h 2020-05-06 06:51:36 -04:00
kvm_util.h KVM: selftests: Introduce steal-time test 2020-03-16 17:59:07 +01:00
sparsebit.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 482 2019-06-19 17:09:52 +02:00
test_util.h KVM: selftests: Rework timespec functions and usage 2020-03-18 14:08:56 +01:00