From 5e846eaa7894446a10d21e6cdddd9b256b28a929 Mon Sep 17 00:00:00 2001 From: Glauber Costa Date: Thu, 2 Oct 2008 11:21:52 -0300 Subject: [PATCH] Fix compilation with --disable-kvm Currently, kvm is failing to build with --disable-kvm. this patch fixes the issue. Signed-off-by: Glauber Costa Signed-off-by: Avi Kivity --- hw/acpi.c | 6 +++++- hw/cirrus_vga.c | 7 +++---- qemu-kvm.h | 2 ++ 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/hw/acpi.c b/hw/acpi.c index 05f5dc00a4..7a7a5341e3 100644 --- a/hw/acpi.c +++ b/hw/acpi.c @@ -726,7 +726,11 @@ void qemu_system_cpu_hot_add(int cpu, int state) { CPUState *env; - if ((state) && (!qemu_kvm_cpu_env(cpu))) { + if (state +#ifdef USE_KVM + && (!qemu_kvm_cpu_env(cpu)) +#endif + ) { env = pc_new_cpu(cpu, model, 1); if (!env) { fprintf(stderr, "cpu %d creation failed\n", cpu); diff --git a/hw/cirrus_vga.c b/hw/cirrus_vga.c index a19bf5e6ae..6739906e5e 100644 --- a/hw/cirrus_vga.c +++ b/hw/cirrus_vga.c @@ -2677,14 +2677,13 @@ static void kvm_update_vga_alias(CirrusVGAState *s, int ok, int bank) if (!s->aliases_enabled || base != s->aliased_bank_base[bank] || limit != s->aliased_bank_limit[bank]) { - kvm_create_memory_alias(kvm_context, - 0xa0000 + bank * 0x8000, - limit, base); + kvm_qemu_create_memory_alias(0xa0000 + bank * 0x8000, + limit, base); s->aliased_bank_base[bank] = base; s->aliased_bank_limit[bank] = limit; } } else { - kvm_destroy_memory_alias(kvm_context, 0xa0000 + bank * 0x8000); + kvm_qemu_destroy_memory_alias(0xa0000 + bank * 0x8000); } } diff --git a/qemu-kvm.h b/qemu-kvm.h index 0e5c1e7141..283f13a56a 100644 --- a/qemu-kvm.h +++ b/qemu-kvm.h @@ -107,6 +107,8 @@ extern kvm_context_t kvm_context; #define qemu_kvm_irqchip_in_kernel() (0) #define qemu_kvm_pit_in_kernel() (0) #define qemu_kvm_has_sync_mmu() (0) +#define kvm_load_registers(env) do {} while(0) +#define kvm_save_registers(env) do {} while(0) #endif void kvm_mutex_unlock(void); -- 2.11.4.GIT