From patchwork Thu Jun 11 13:53:28 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kiszka X-Patchwork-Id: 29559 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 n5BDrf6N022037 for ; Thu, 11 Jun 2009 13:53:41 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752994AbZFKNxg (ORCPT ); Thu, 11 Jun 2009 09:53:36 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752968AbZFKNxg (ORCPT ); Thu, 11 Jun 2009 09:53:36 -0400 Received: from fmmailgate03.web.de ([217.72.192.234]:34203 "EHLO fmmailgate03.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752375AbZFKNxf (ORCPT ); Thu, 11 Jun 2009 09:53:35 -0400 Received: from smtp08.web.de (fmsmtp08.dlan.cinetic.de [172.20.5.216]) by fmmailgate03.web.de (Postfix) with ESMTP id 0B8C0FF6F7D7; Thu, 11 Jun 2009 15:53:35 +0200 (CEST) Received: from [92.74.59.174] (helo=[192.168.1.10]) by smtp08.web.de with asmtp (TLSv1:AES256-SHA:256) (WEB.DE 4.110 #277) id 1MEkik-0001xW-00; Thu, 11 Jun 2009 15:53:34 +0200 Message-ID: <4A310C58.6050301@web.de> Date: Thu, 11 Jun 2009 15:53:28 +0200 From: Jan Kiszka User-Agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); de; rv:1.8.1.12) Gecko/20080226 SUSE/2.0.0.12-1.1 Thunderbird/2.0.0.12 Mnenhy/0.7.5.666 MIME-Version: 1.0 To: Beth Kon , Glauber Costa CC: kvm Subject: Re: qemu-kvm broken after ./configure --disable-kvm References: <4A30FBA3.1070404@us.ibm.com> In-Reply-To: <4A30FBA3.1070404@us.ibm.com> X-Enigmail-Version: 0.95.7 X-Sender: jan.kiszka@web.de X-Provags-ID: V01U2FsdGVkX1+hWCs4MbogzH3H69GvUIhnDzDkGO2O2iSlHuBa fR/zINvNn06AXJxWsl/+Ae+L3kImGXktAzVqJJZmSi04MU2++i QlCGw6SBM= Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org 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 where KVMPITState is defined as #ifdef KVM_CAP_PIT typedef struct kvm_pit_state KVMPITState; #else typedef struct { } KVMPITState; #endif Thanks, Jan 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;