Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Nxj20-0006An-Nh for qemu-devel@nongnu.org; Fri, 02 Apr 2010 11:43:36 -0400 Received: from [140.186.70.92] (port=40578 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Nxj1z-0006AA-9u for qemu-devel@nongnu.org; Fri, 02 Apr 2010 11:43:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Nxj1x-0001t3-Ua for qemu-devel@nongnu.org; Fri, 02 Apr 2010 11:43:35 -0400 Received: from mail-pw0-f45.google.com ([209.85.160.45]:33217) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Nxj1x-0001sz-Oh for qemu-devel@nongnu.org; Fri, 02 Apr 2010 11:43:33 -0400 Received: by pwi6 with SMTP id 6so1723476pwi.4 for ; Fri, 02 Apr 2010 08:43:33 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <4BB6086B.2080009@codemonkey.ws> References: <4BB4FED5.2080508@codemonkey.ws> <4BB606BE.9000508@redhat.com> <4BB6086B.2080009@codemonkey.ws> Date: Fri, 2 Apr 2010 18:43:32 +0300 Message-ID: From: Blue Swirl Content-Type: text/plain; charset=UTF-8 Subject: [Qemu-devel] Re: [PATCH 1/2] Move KVM init to arch_init.c, compile vl.c once List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: Paolo Bonzini , qemu-devel On 4/2/10, Anthony Liguori wrote: > On 04/02/2010 10:01 AM, Paolo Bonzini wrote: > > > On 04/01/2010 10:27 PM, Blue Swirl wrote: > > > > > It will not be safe to use kvm_enabled() in vl.c, so there needs to be > > > a target dependent helper. The call to kvm_init could remain in vl.c, > > > likewise it's not strictly needed to move kvm_allowed to arch_init.c. > > > > > > > Not really, because kvm_allowed _can_ be used from once-compiled files. > The attached patch makes kvm-all.c be compiled always, even if !CONFIG_KVM; > functions that require kvm are almost always omitted for now (so checking > kvm_enabled() is required to call them). However, kvm_init is stubbed so > that vl.c can call it. > > > > In the future we could add more stubbing and ultimately do this > unconditionally: > > > > #define kvm_enabled() kvm_allowed > > > > With this patch vl.c can already be compiled once, but I did not include > it because it would conflict with my balloon.c series; I'm doing enough > rebasing these days. Also, qemu-kvm is a bit behind qemu and all these > patches are nightmares for the merges, so it's better IMO if things are left > to calm down a bit. > > > > Having kvm-all.c compile with and without CONFIG_KVM is pretty ugly IMHO. > > Is compiling vl.c once really that important of a goal? Wouldn't it be > better to split bits out of vl.c and have those compile once? Ideally, vl.c > should be so small that compiling per-target shouldn't matter. But the only thing preventing compiling whole vl.c once is just KVM init. I'll send a new patch, hopefully it's better.