target-i386: Avoid kvm related compiler error
PATCH 1/1 target-i386: Avoid kvm related compiler error
Some versions of kvm.h (debian lenny) define KVM_CAP_VCPU_EVENTS without defining KVM_VCPUEVENT_VALID_NMI_PENDING or KVM_VCPUEVENT_VALID_SIPI_VECTOR.
Without the patch, compilation fails:
CC x86_64-softmmu/kvm.o
/qemu/target-i386/kvm.c: In function 'kvm_put_vcpu_events':
/qemu/target-i386/kvm.c:824: error: 'KVM_VCPUEVENT_VALID_NMI_PENDING' undeclared (first use in this function) /qemu/target-i386/kvm.c:824: error: (Each undeclared identifier is reported only once /qemu/target-i386/kvm.c:824: error: for each function it appears in.) /qemu/target-i386/kvm.c:824: error: 'KVM_VCPUEVENT_VALID_SIPI_VECTOR' undeclared (first use in this function) make[1]: *** [kvm.o] Error 1
--- target-i386/kvm.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
target-i386/kvm.c +1 -1
@@ -796,7 +796,7 @@ static int kvm_get_mp_state(CPUState *env)static int kvm_put_vcpu_events (CPUState *env,int level) { -#ifdef KVM_CAP_VCPU_EVENTS +#if defined(KVM_CAP_VCPU_EVENTS ) && defined(KVM_VCPUEVENT_VALID_NMI_PENDING )struct kvm_vcpu_events events;if (!kvm_has_vcpu_events ()) {
Signature · 1 line
1.7.1
Quoted 3 lines · Stefan Weil
Some versions of
kvm.h(debian lenny) defineKVM_CAP_VCPU_EVENTSwithout definingKVM_VCPUEVENT_VALID_NMI_PENDINGorKVM_VCPUEVENT_VALID_SIPI_VECTOR.
This rather looks like a bug to be sent to debian. Until they fixed their backport (I just hope it's a user space header issue only...), you could disable KVM or use kvm-kmod which delivers proper upstream headers.
Jan
Quoted 30 lines
Without the patch, compilation fails:
CC
x86_64-softmmu/kvm.o
/qemu/target-i386/kvm.c: In function 'kvm_put_vcpu_events':
/qemu/target-i386/kvm.c:824: error: 'KVM_VCPUEVENT_VALID_NMI_PENDING' undeclared (first use in this function) /qemu/target-i386/kvm.c:824: error: (Each undeclared identifier is reported only once /qemu/target-i386/kvm.c:824: error: for each function it appears in.) /qemu/target-i386/kvm.c:824: error: 'KVM_VCPUEVENT_VALID_SIPI_VECTOR' undeclared (first use in this function) make[1]: *** [kvm.o] Error 1Cc Jan Kiszka <[email protected]>Signed-off-by Stefan Weil <[email protected]>--- target-i386/kvm.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)target-i386/kvm.c +1
-1@@ -796,7 +796,7 @@ static int kvm_get_mp_state(CPUState *env)static int kvm_put_vcpu_events (CPUState *env,int level) { -#ifdef KVM_CAP_VCPU_EVENTS +#if defined(KVM_CAP_VCPU_EVENTS ) && defined(KVM_VCPUEVENT_VALID_NMI_PENDING )struct kvm_vcpu_events events;if (!kvm_has_vcpu_events ()) {