Beth Kon wrote: > Building latest git with ./configure --disable-kvm breaks with errors in > pcspk.c With latest git, things break much earlier in case your host does not provide linux/kvm.h because libkvm-all.h includes it unconditionally. I would like to push this task to Glauber as he is already shuffling around most of the involved code: Could you have a look on --disable-kvm too while you are at it? My basic idea would be to get rid of direct qemu-kvm.h includes so that you always obtain the required [proto]types by including kvm.h, independent of CONFIG_KVM and already prepared for upstream where there is no qemu-kvm.h. Regarding the bugs I left behind in pcspk.c, I would suggest something like diff --git a/hw/pcspk.c b/hw/pcspk.c index 9e1b59a..5b624d1 100644 --- a/hw/pcspk.c +++ b/hw/pcspk.c @@ -51,10 +51,9 @@ static const char *s_spk = "pcspk"; static PCSpkState pcspk_state; #ifdef USE_KVM_PIT -static void kvm_get_pit_ch2(PITState *pit, - struct kvm_pit_state *inkernel_state) +static void kvm_get_pit_ch2(PITState *pit, KVMPITState *inkernel_state) { - struct kvm_pit_state pit_state; + KVMPITState pit_state; if (kvm_enabled() && qemu_kvm_pit_in_kernel()) { kvm_get_pit(kvm_context, &pit_state); @@ -68,8 +67,7 @@ static void kvm_get_pit_ch2(PITState *pit, } } -static void kvm_set_pit_ch2(PITState *pit, - struct kvm_pit_state *inkernel_state) +static void kvm_set_pit_ch2(PITState *pit, KVMPITState *inkernel_state) { if (kvm_enabled() && qemu_kvm_pit_in_kernel()) { inkernel_state->channels[2].mode = pit->channels[2].mode; @@ -82,9 +80,9 @@ static void kvm_set_pit_ch2(PITState *pit, } #else static inline void kvm_get_pit_ch2(PITState *pit, - kvm_pit_state *inkernel_state) { } + KVMPITState *inkernel_state) { } static inline void kvm_set_pit_ch2(PITState *pit, - kvm_pit_state *inkernel_state) { } + KVMPITState *inkernel_state) { } #endif static inline void generate_samples(PCSpkState *s) @@ -168,7 +166,7 @@ static uint32_t pcspk_ioport_read(void *opaque, uint32_t addr) static void pcspk_ioport_write(void *opaque, uint32_t addr, uint32_t val) { - struct kvm_pit_state inkernel_state; + KVMPITState inkernel_state; PCSpkState *s = opaque; const int gate = val & 1; where KVMPITState is defined as #ifdef KVM_CAP_PIT typedef struct kvm_pit_state KVMPITState; #else typedef struct { } KVMPITState; #endif Thanks, Jan
Attachment:
signature.asc
Description: OpenPGP digital signature