From: Alexander Graf Subject: [PATCH] Fix KVM includes in helper.c Date: Mon, 22 Dec 2008 17:54:10 +0100 Message-ID: <1229964850-23316-1-git-send-email-agraf@suse.de> Cc: avi@redhat.com To: kvm@vger.kernel.org Return-path: Received: from cantor.suse.de ([195.135.220.2]:49918 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751853AbYLVQxz (ORCPT ); Mon, 22 Dec 2008 11:53:55 -0500 Sender: kvm-owner@vger.kernel.org List-ID: By default target-i386/helper.c does not include config.h, so no code in there knows if we're enabling KVM or not. This breaks the nested activation, as that's depending on the config options. Of course, with this patch applied the CPUID KVM checks are applied twice, as now kvm_enabled() does not default to true for the cpuid helper functions. Maybe it's a good idea to remove the qemu-kvm-x86.c cpuid code? This patch fixes compilation broken thanks to my nested SVM patches. Signed-off-by: Alexander Graf --- qemu/qemu-kvm.h | 1 + qemu/target-i386/helper.c | 1 + 2 files changed, 2 insertions(+), 0 deletions(-) diff --git a/qemu/qemu-kvm.h b/qemu/qemu-kvm.h index 154ff63..7224820 100644 --- a/qemu/qemu-kvm.h +++ b/qemu/qemu-kvm.h @@ -161,6 +161,7 @@ int qemu_kvm_has_sync_mmu(void); void kvm_init_vcpu(CPUState *env); #else #define kvm_enabled() (0) +#define kvm_nested 0 #define qemu_kvm_irqchip_in_kernel() (0) #define qemu_kvm_pit_in_kernel() (0) #define kvm_has_sync_mmu() (0) diff --git a/qemu/target-i386/helper.c b/qemu/target-i386/helper.c index 1c5b85c..04da2b0 100644 --- a/qemu/target-i386/helper.c +++ b/qemu/target-i386/helper.c @@ -30,6 +30,7 @@ #include "qemu-common.h" #include "kvm.h" +#include "config.h" #include "qemu-kvm.h" //#define DEBUG_MMU -- 1.5.6