From 8b9540d75fbab2192982fdbf918f36296d0d050d Mon Sep 17 00:00:00 2001 From: Gregory Haskins Date: Tue, 3 Jul 2007 07:40:32 -0400 Subject: [PATCH] kvm: qemu: make the kvm_allowed flag always defined so we dont need #ifdefs Non-performance critical code is made more awkward by having to always define both "#ifdef KVM" and "if (kvm_allowed)". Define "kvm_allowed = 0" by default. Anthony Ligouri is credited with the idea. Signed-off-by: Gregory Haskins Signed-off-by: Avi Kivity --- qemu/qemu-kvm.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/qemu/qemu-kvm.c b/qemu/qemu-kvm.c index 68a6ea5b..39b62ca6 100644 --- a/qemu/qemu-kvm.c +++ b/qemu/qemu-kvm.c @@ -3,6 +3,14 @@ #include "config-host.h" #ifdef USE_KVM + #define KVM_ALLOWED_DEFAULT 1 +#else + #define KVM_ALLOWED_DEFAULT 0 +#endif + +int kvm_allowed = KVM_ALLOWED_DEFAULT; + +#ifdef USE_KVM #include "exec.h" @@ -14,7 +22,6 @@ extern void perror(const char *s); -int kvm_allowed = 1; kvm_context_t kvm_context; static struct kvm_msr_list *kvm_msr_list; static int kvm_has_msr_star; -- 2.11.4.GIT