Skip to contentSkip to conversation

qemu-kvm: Fix kvm-disabled build

PATCH Applied Jan Kiszka 2 participants 2 messages Jul 4, 2009 – Jul 6, 2009 KVM

lore
Share & tools
lore

Jan Kiszka

author
#0 lore raw

PATCH 1/1 qemu-kvm: Fix kvm-disabled build

This addresses all issues that currently block building qemu-kvm with kvm support switched off. It's a pragmatic approach as more cleanups are actually required /wrt {kvm,libkvm,qemu-kvm}.h.

---

 hw/pcspk.c   |    4 ++--
 libkvm-all.h |    8 ++++++++
 qemu-kvm.h   |    3 ++-
 3 files changed, 12 insertions(+), 3 deletions(-)
hw/pcspk.c +2 -2
index 9e1b59a..3d3eba4 100644
@@ -82,9 +82,9 @@ static void kvm_set_pit_ch2(PITState *pit,
 }
 #else
 static inline void kvm_get_pit_ch2(PITState *pit,
-                                   kvm_pit_state *inkernel_state) { }
+                                   struct kvm_pit_state *inkernel_state) { }
 static inline void kvm_set_pit_ch2(PITState *pit,
-                                   kvm_pit_state *inkernel_state) { }
+                                   struct kvm_pit_state *inkernel_state) { }
 #endif
 
 static inline void generate_samples(PCSpkState *s)
libkvm-all.h +8 -0
index ecd3065..f348e69 100644
@@ -5,6 +5,8 @@
 #ifndef LIBKVM_H
 #define LIBKVM_H
 
+#ifdef USE_KVM
+
 #if defined(__s390__)
 #include <asm/ptrace.h>
 #endif
@@ -938,4 +940,10 @@ int kvm_assign_set_msix_entry(kvm_context_t kvm,
 
 uint32_t kvm_get_supported_cpuid(kvm_context_t kvm, uint32_t function, int reg);
 
+#else /* !USE_KVM */
+
+struct kvm_pit_state { };
+
+#endif /* !USE_KVM */
+
 #endif
qemu-kvm.h +2 -1
index eb99bc4..18a5b7f 100644
@@ -12,6 +12,8 @@
 
 #include <signal.h>
 
+#include "libkvm-all.h"
+
 int kvm_main_loop(void);
 int kvm_qemu_init(void);
 int kvm_qemu_create_context(void);
@@ -141,7 +143,6 @@ void kvm_arch_do_ioperm(void *_data);
 #define BITMAP_SIZE(m) (ALIGN(((m)>>TARGET_PAGE_BITS), HOST_LONG_BITS) / 8)
 
 #ifdef USE_KVM
-#include "libkvm-all.h"
 #include "sys-queue.h"
 
 extern int kvm_allowed;
Applied
#1 lore raw
Quoted 5 lines · Jan Kiszka

This addresses all issues that currently block building qemu-kvm with kvm support switched off. It's a pragmatic approach as more cleanups are actually required /wrt {kvm,libkvm,qemu-kvm}.h.

Applied, thanks.

Signature · 1 line
error compiling committee.c: too many arguments to function