From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Kiszka Subject: Re: [PATCH] Fix pcspk build with kvm disabled Date: Mon, 29 Jun 2009 18:00:42 +0200 Message-ID: <4A48E52A.9060004@siemens.com> References: <1246288762.11688.39.camel@blaa> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: Avi Kivity , kvm To: Mark McLoughlin Return-path: Received: from gecko.sbs.de ([194.138.37.40]:23835 "EHLO gecko.sbs.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759642AbZF2QA7 (ORCPT ); Mon, 29 Jun 2009 12:00:59 -0400 In-Reply-To: <1246288762.11688.39.camel@blaa> Sender: kvm-owner@vger.kernel.org List-ID: Mark McLoughlin wrote: > Errors are: >=20 > hw/pcspk.c:85: error: expected declaration specifiers or =E2=80=98.= =2E.=E2=80=99 before =E2=80=98kvm_pit_state=E2=80=99 > hw/pcspk.c:87: error: expected declaration specifiers or =E2=80=98.= =2E.=E2=80=99 before =E2=80=98kvm_pit_state=E2=80=99 > hw/pcspk.c: In function =E2=80=98pcspk_callback=E2=80=99: > hw/pcspk.c:114: error: too many arguments to function =E2=80=98kvm_= get_pit_ch2=E2=80=99 > hw/pcspk.c: In function =E2=80=98pcspk_ioport_read=E2=80=99: > hw/pcspk.c:161: error: too many arguments to function =E2=80=98kvm_= get_pit_ch2=E2=80=99 > hw/pcspk.c: In function =E2=80=98pcspk_ioport_write=E2=80=99: > hw/pcspk.c:171: error: storage size of =E2=80=98inkernel_state=E2=80= =99 isn=E2=80=99t known > hw/pcspk.c:175: error: too many arguments to function =E2=80=98kvm_= get_pit_ch2=E2=80=99 > hw/pcspk.c:185: error: too many arguments to function =E2=80=98kvm_= set_pit_ch2=E2=80=99 > hw/pcspk.c:171: warning: unused variable =E2=80=98inkernel_state=E2= =80=99 >=20 > Signed-off-by: Mark McLoughlin > Cc: Jan Kiszka > --- > hw/pcspk.c | 6 +++++- > 1 files changed, 5 insertions(+), 1 deletions(-) >=20 > diff --git a/hw/pcspk.c b/hw/pcspk.c > index 9e1b59a..fb823d5 100644 > --- a/hw/pcspk.c > +++ b/hw/pcspk.c > @@ -80,11 +80,15 @@ static void kvm_set_pit_ch2(PITState *pit, > kvm_set_pit(kvm_context, inkernel_state); > } > } > -#else > +#elif defined(USE_KVM) > static inline void kvm_get_pit_ch2(PITState *pit, > kvm_pit_state *inkernel_state) { = } > static inline void kvm_set_pit_ch2(PITState *pit, > kvm_pit_state *inkernel_state) { = } > +#else > +typedef struct kvm_pit_state { char dummy; } kvm_pit_state; If you do this... > +#define kvm_get_pit_ch2(p, s) do { (void)s; } while(0) > +#define kvm_set_pit_ch2(p, s) do { (void)s; } while(0) you don't need this. > #endif > =20 > static inline void generate_samples(PCSpkState *s) Basically that's band aid, but I could live with it for now. A cleaner approach would be to push the dummy type into (qemu-)kvm.h, ie. the fil= e responsible for importing the kernel headers in the USE_KVM/CONFIG_KVM = case. Note that qemu-kvm still breaks in the non-kvm build for other reasons here. I wanted to look into this but got detracted. Jan --=20 Siemens AG, Corporate Technology, CT SE 2 Corporate Competence Center Embedded Linux