From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Kiszka Subject: Re: [PATCH] Fix non-KVM build Date: Thu, 16 Jul 2009 10:54:05 +0200 Message-ID: <4A5EEAAD.5040101@siemens.com> References: <1245867226-30604-1-git-send-email-aliguori@us.ibm.com> <20090715175312.GH9642@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Anthony Liguori , kvm@vger.kernel.org, Avi Kivity , Dustin Kirkland To: "Michael S. Tsirkin" Return-path: Received: from lizzard.sbs.de ([194.138.37.39]:15823 "EHLO lizzard.sbs.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753049AbZGPIy3 (ORCPT ); Thu, 16 Jul 2009 04:54:29 -0400 In-Reply-To: <20090715175312.GH9642@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: Michael S. Tsirkin wrote: > On Wed, Jun 24, 2009 at 01:13:46PM -0500, Anthony Liguori wrote: >> This introduces some #ifdefs in pcspk to fix the build when KVM isn't enabled. >> >> Signed-off-by: Anthony Liguori >> --- >> hw/pcspk.c | 15 +++++++++------ >> 1 files changed, 9 insertions(+), 6 deletions(-) >> >> diff --git a/hw/pcspk.c b/hw/pcspk.c >> index 9e1b59a..236995a 100644 >> --- a/hw/pcspk.c >> +++ b/hw/pcspk.c >> @@ -80,11 +80,6 @@ static void kvm_set_pit_ch2(PITState *pit, >> kvm_set_pit(kvm_context, inkernel_state); >> } >> } >> -#else >> -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) { } >> #endif >> > > The version with stubs looks cleaner to me. IMO we really should be > moving away from ifdefs for features, and only use them for > compiler-specific things. If for no other reason, then because it > increases the common code that is compiled for all platforms, > decreasing the chance that people submit a patch that does not > build on soe platform. > > Is the issue with struct kvm_pit_state? > Can't we just stub it out as well? > > struct kvm_pit_state {}; It's solved like that in current git. Do you still face problems? Jan -- Siemens AG, Corporate Technology, CT SE 2 Corporate Competence Center Embedded Linux