From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Michael S. Tsirkin" Subject: Re: [PATCH 2/2] fix compilation with kvm disabled Date: Wed, 8 Jul 2009 15:20:05 +0300 Message-ID: <20090708122005.GE12440@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> <4A548D01.2050600@redhat.com> <20090708121321.GC12440@redhat.com> <4A548EF2.10303@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Glauber Costa , kvm@vger.kernel.org To: Avi Kivity Return-path: Received: from mx2.redhat.com ([66.187.237.31]:34335 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753576AbZGHMUp (ORCPT ); Wed, 8 Jul 2009 08:20:45 -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 n68CKjCM012446 for ; Wed, 8 Jul 2009 08:20:45 -0400 Content-Disposition: inline In-Reply-To: <4A548EF2.10303@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On Wed, Jul 08, 2009 at 03:20:02PM +0300, Avi Kivity wrote: > On 07/08/2009 03:13 PM, Michael S. Tsirkin wrote: >>>> I think it's time we stopped worrying about builds against old kernel >>>> headers or without them. What do we gain from it? >>>> >>>> >>> qemu upstream doesn't carry its own headers, so it we want to merge, we >>> need to work against old headers. >>> >> >> Was there ever discussion on this? I think the right thing to do is to >> add own headers to qemu upstream. >> > > Discussion yes, conclusion no. > >>>> 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. >>>> >>>> >>> Doesn't work with -O0 (or if it does, we can't count on it). >>> >> >> With -O0 you get a ton of dead code anyway. Who cares > > People who debug (though -O1 works fine most of the time). It also > feels unclean to rely on optimization for correctness. I do not propoise to rely on optimization for correctness. The code under if (0) will get compiled with -O0 (and we need to carry our headers for this) but will never run. -- MST