From patchwork Mon Jun 29 15:19:22 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Mark McLoughlin X-Patchwork-Id: 32968 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n5TFJc65022837 for ; Mon, 29 Jun 2009 15:19:38 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755470AbZF2PTc (ORCPT ); Mon, 29 Jun 2009 11:19:32 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753741AbZF2PTc (ORCPT ); Mon, 29 Jun 2009 11:19:32 -0400 Received: from mx2.redhat.com ([66.187.237.31]:60961 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752688AbZF2PTb (ORCPT ); Mon, 29 Jun 2009 11:19:31 -0400 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n5TFJZHI022196; Mon, 29 Jun 2009 11:19:35 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id n5TFJYWA009637; Mon, 29 Jun 2009 11:19:34 -0400 Received: from [IPv6:::1] (sebastian-int.corp.redhat.com [172.16.52.221]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id n5TFJW9m021043; Mon, 29 Jun 2009 11:19:33 -0400 Subject: [PATCH] Fix pcspk build with kvm disabled From: Mark McLoughlin Reply-To: Mark McLoughlin To: Avi Kivity Cc: Jan Kiszka , kvm Date: Mon, 29 Jun 2009 16:19:22 +0100 Message-Id: <1246288762.11688.39.camel@blaa> Mime-Version: 1.0 X-Scanned-By: MIMEDefang 2.58 on 172.16.27.26 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Errors are: hw/pcspk.c:85: error: expected declaration specifiers or ‘...’ before ‘kvm_pit_state’ hw/pcspk.c:87: error: expected declaration specifiers or ‘...’ before ‘kvm_pit_state’ hw/pcspk.c: In function ‘pcspk_callback’: hw/pcspk.c:114: error: too many arguments to function ‘kvm_get_pit_ch2’ hw/pcspk.c: In function ‘pcspk_ioport_read’: hw/pcspk.c:161: error: too many arguments to function ‘kvm_get_pit_ch2’ hw/pcspk.c: In function ‘pcspk_ioport_write’: hw/pcspk.c:171: error: storage size of ‘inkernel_state’ isn’t known hw/pcspk.c:175: error: too many arguments to function ‘kvm_get_pit_ch2’ hw/pcspk.c:185: error: too many arguments to function ‘kvm_set_pit_ch2’ hw/pcspk.c:171: warning: unused variable ‘inkernel_state’ Signed-off-by: Mark McLoughlin Cc: Jan Kiszka --- hw/pcspk.c | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-) 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; +#define kvm_get_pit_ch2(p, s) do { (void)s; } while(0) +#define kvm_set_pit_ch2(p, s) do { (void)s; } while(0) #endif static inline void generate_samples(PCSpkState *s)