From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH] Clean up KVM/QEMU interaction Date: Wed, 30 Jan 2008 11:47:40 +0200 Message-ID: <47A047BC.10101@qumranet.com> References: <1201646815-5071-1-git-send-email-aliguori@us.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org, kvm-ppc-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org, Jerone Young , kvm-ia64-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org To: Anthony Liguori Return-path: In-Reply-To: <1201646815-5071-1-git-send-email-aliguori-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org Errors-To: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org List-Id: kvm.vger.kernel.org Anthony Liguori wrote: > This patch attempts to clean up the interactions between KVM and QEMU. Sorry > for such a big patch, but I don't think there's a better way to approach this > such that it's still bisect friendly. I think this is most of what's needed to > get basic KVM support into QEMU though. > > Right now, there's a mix of #ifdef USE_KVM, if (kvm_allowed), and various > extern declarations. It's all pretty fugly and there's a lot of mistakes due > to it. > > The following patch eliminates almost all uses of #ifdef USE_KVM by introducing > a kvm_enabled() macro. If USE_KVM is set, this macro evaluates to kvm_allowed. > If USE_KVM isn't set, the macro evaluates to 0. > > Since GCC eliminates if (0) blocks, this is just as good as using #ifdef. By > making sure that we never call into libkvm directly from QEMU, we can also just > not link qemu-kvm when USE_KVM isn't set instead of having the entire file > wrapped in a USE_KVM. > > It might not when optimizations are disabled. Please test. Also, long term (when we're fully merged into qemu), we need to be able to build without libkvm or linux/kvm.h installed. That means we can't use any of the kvm.h defines and data structures. So for example, kvm_qemu_check_extension(KVM_CAP_USER_MEMORY)) needs to be changed to kvm_qemu_supports_userspace_memory(). -- error compiling committee.c: too many arguments to function ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/