From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH 2/2] fix compilation with kvm disabled Date: Wed, 08 Jul 2009 15:10:24 +0300 Message-ID: <4A548CB0.50000@redhat.com> References: <1246991791-21741-1-git-send-email-glommer@redhat.com> <1246991791-21741-2-git-send-email-glommer@redhat.com> <1246991791-21741-3-git-send-email-glommer@redhat.com> <20090708075913.GA12440@redhat.com> <20090708120958.GW3528@poweredge.glommer> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: "Michael S. Tsirkin" , kvm@vger.kernel.org To: Glauber Costa Return-path: Received: from mx2.redhat.com ([66.187.237.31]:41493 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752342AbZGHMHz (ORCPT ); Wed, 8 Jul 2009 08:07:55 -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 n68C7sq2008574 for ; Wed, 8 Jul 2009 08:07:54 -0400 In-Reply-To: <20090708120958.GW3528@poweredge.glommer> Sender: kvm-owner@vger.kernel.org List-ID: On 07/08/2009 03:09 PM, Glauber Costa wrote: > >> I believe that the right thing to do is to define kvm_enabled as a macro >> returning 0, and let compiler optimize the code out. >> > that already happens with kvm_enabled(). > I have no idea why the compiler do not rip of code when we also test for > qemu_kvm_irqchip_in_kernel() or other things. > > what we could do, is to only test for qemu_kvm_irqchip_in_kernel(), > using the hidden assumption that if kvm is not enabled, irqchip tests > will always return false. > > It is a little bit messy, though We should make the call unconditional and do the kvm_enabled/irqchip_in_kernel checks in the kvm-specific function. This way common code is only minimally affected. -- error compiling committee.c: too many arguments to function