From: Jerone Young <[EMAIL PROTECTED]>

This fixes compilation issues for PowerPC and other non x86 archs that do not
have in kernel pit. The pit code is added into the kvm_context in kvm-common.h
and the error causing the issue is coming from a definition in qemu. This seems
to be the proper fix as there is also a common function:

  kvm_irqchip_in_kernel

for in kernel irq that handles this the same way.

Signed-off-by: Jerone Young <[EMAIL PROTECTED]>
Signed-off-by: Avi Kivity <[EMAIL PROTECTED]>

diff --git a/libkvm/libkvm-x86.c b/libkvm/libkvm-x86.c
index d1809fd..6dba91d 100644
--- a/libkvm/libkvm-x86.c
+++ b/libkvm/libkvm-x86.c
@@ -660,12 +660,3 @@ int kvm_disable_tpr_access_reporting(kvm_context_t kvm, 
int vcpu)
 }
 
 #endif
-
-int kvm_pit_in_kernel(kvm_context_t kvm)
-{
-#ifdef KVM_CAP_PIT
-       return kvm->pit_in_kernel;
-#else
-       return 0;
-#endif
-}
diff --git a/libkvm/libkvm.c b/libkvm/libkvm.c
index a7cc0e6..3d93396 100644
--- a/libkvm/libkvm.c
+++ b/libkvm/libkvm.c
@@ -962,3 +962,8 @@ int kvm_irqchip_in_kernel(kvm_context_t kvm)
 {
     return kvm->irqchip_in_kernel;
 }
+
+int kvm_pit_in_kernel(kvm_context_t kvm)
+{
+       return kvm->pit_in_kernel;
+}
diff --git a/libkvm/libkvm.h b/libkvm/libkvm.h
index 4b40d2c..61e7e98 100644
--- a/libkvm/libkvm.h
+++ b/libkvm/libkvm.h
@@ -530,6 +530,13 @@ int kvm_set_lapic(kvm_context_t kvm, int vcpu, struct 
kvm_lapic_state *s);
 
 #endif
 
+/*!
+ * \brief Query wheather in kernel pit is used
+ *
+ *  \param kvm Pointer to the current kvm_context
+ */
+int kvm_pit_in_kernel(kvm_context_t kvm);
+
 #ifdef KVM_CAP_PIT
 
 /*!

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
kvm-commits mailing list
kvm-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-commits

Reply via email to