[PATCH 4/4] Fix --disable-kvm build

2008-08-12 Thread Philippe Gerum
This patch fixes a few locations where --disable-kvm was not enforced when
applicable.

Signed-off-by: Philippe Gerum <[EMAIL PROTECTED]>
---
 qemu/gdbstub.c  |2 +-
 qemu/hw/acpi.c  |6 +-
 qemu/hw/vga.c   |2 ++
 qemu/qemu-kvm.h |4 
 4 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/qemu/gdbstub.c b/qemu/gdbstub.c
index d828844..2af7830 100644
--- a/qemu/gdbstub.c
+++ b/qemu/gdbstub.c
@@ -33,8 +33,8 @@
 #include "qemu-char.h"
 #include "sysemu.h"
 #include "gdbstub.h"
-#include "qemu-kvm.h"
 #endif
+#include "qemu-kvm.h"
 
 #include "qemu_socket.h"
 #ifdef _WIN32
diff --git a/qemu/hw/acpi.c b/qemu/hw/acpi.c
index e3cd8d7..35bac86 100644
--- a/qemu/hw/acpi.c
+++ b/qemu/hw/acpi.c
@@ -23,10 +23,8 @@
 #include "sysemu.h"
 #include "i2c.h"
 #include "smbus.h"
-#ifdef USE_KVM
-#include "qemu-kvm.h"
-#endif
 #include "string.h"
+#include "qemu-kvm.h"
 
 //#define DEBUG
 
@@ -723,9 +721,7 @@ void qemu_system_cpu_hot_add(int cpu, int state)
 fprintf(stderr, "cpu %d creation failed\n", cpu);
 return;
 }
-#ifdef USE_KVM
 kvm_init_new_ap(cpu, env);
-#endif
 }
 
 qemu_set_irq(pm_state->irq, 1);
diff --git a/qemu/hw/vga.c b/qemu/hw/vga.c
index 95d6033..f5c472c 100644
--- a/qemu/hw/vga.c
+++ b/qemu/hw/vga.c
@@ -1981,6 +1981,7 @@ typedef struct PCIVGAState {
 VGAState vga_state;
 } PCIVGAState;
 
+#ifdef USE_KVM
 void vga_update_vram_mapping(VGAState *s, unsigned long vga_ram_begin,
 unsigned long vga_ram_end)
 {
@@ -2010,6 +2011,7 @@ void vga_update_vram_mapping(VGAState *s, unsigned long 
vga_ram_begin,
s->map_end  = vga_ram_end;
 }
 }
+#endif
 
 static void vga_map(PCIDevice *pci_dev, int region_num,
 uint32_t addr, uint32_t size, int type)
diff --git a/qemu/qemu-kvm.h b/qemu/qemu-kvm.h
index 7e28428..9ba81a3 100644
--- a/qemu/qemu-kvm.h
+++ b/qemu/qemu-kvm.h
@@ -114,6 +114,10 @@ extern kvm_context_t kvm_context;
 #define kvm_enabled() (0)
 #define qemu_kvm_irqchip_in_kernel() (0)
 #define qemu_kvm_pit_in_kernel() (0)
+#define qemu_kvm_cpu_env(cpu)  ({ (void)cpu; NULL; })
+#define kvm_save_registers(cpu)do { (void)cpu; } while(0)
+#define kvm_load_registers(env)do { (void)env; } while(0)
+#define kvm_init_new_ap(cpu, env)  do { (void)cpu; (void)env; } while(0)
 #endif
 
 void kvm_mutex_unlock(void);
-- 
1.5.4.3

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 4/4] Fix --disable-kvm build

2008-08-13 Thread Avi Kivity

Philippe Gerum wrote:

 static void vga_map(PCIDevice *pci_dev, int region_num,
 uint32_t addr, uint32_t size, int type)
diff --git a/qemu/qemu-kvm.h b/qemu/qemu-kvm.h
index 7e28428..9ba81a3 100644
--- a/qemu/qemu-kvm.h
+++ b/qemu/qemu-kvm.h
@@ -114,6 +114,10 @@ extern kvm_context_t kvm_context;
 #define kvm_enabled() (0)
 #define qemu_kvm_irqchip_in_kernel() (0)
 #define qemu_kvm_pit_in_kernel() (0)
+#define qemu_kvm_cpu_env(cpu)  ({ (void)cpu; NULL; })
+#define kvm_save_registers(cpu)do { (void)cpu; } while(0)
+#define kvm_load_registers(env)do { (void)env; } while(0)
+#define kvm_init_new_ap(cpu, env)  do { (void)cpu; (void)env; } while(0)
 #endif
 
  


Please use static inline functions rather #defines, especially with 
those statement expressions.


--
error compiling committee.c: too many arguments to function

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html