# HG changeset patch
# User Jerone Young <[EMAIL PROTECTED]>
# Date 1193849564 18000
# Node ID 6a35e049b61391f45d8df6ccb5c11d9effc67bf7
# Parent  edb32b02931230708cc80c38d8260d31d44e0344
Move kvm_get & kmv_set_lapci functions to kvmctl-x86.c

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

diff --git a/libkvm/libkvm-x86.c b/libkvm/libkvm-x86.c
--- a/libkvm/libkvm-x86.c
+++ b/libkvm/libkvm-x86.c
@@ -373,3 +373,34 @@ int kvm_destroy_memory_alias(kvm_context
        return kvm_create_memory_alias(kvm, phys_addr, 0, 0, 0);
 }
 
+#ifdef KVM_CAP_IRQCHIP
+
+int kvm_get_lapic(kvm_context_t kvm, int vcpu, struct kvm_lapic_state *s)
+{
+       int r;
+       if (!kvm->irqchip_in_kernel)
+               return 0;
+       r = ioctl(kvm->vcpu_fd[vcpu], KVM_GET_LAPIC, s);
+       if (r == -1) {
+               r = -errno;
+               perror("kvm_get_lapic");
+       }
+       return r;
+}
+
+int kvm_set_lapic(kvm_context_t kvm, int vcpu, struct kvm_lapic_state *s)
+{
+       int r;
+       if (!kvm->irqchip_in_kernel)
+               return 0;
+       r = ioctl(kvm->vcpu_fd[vcpu], KVM_SET_LAPIC, s);
+       if (r == -1) {
+               r = -errno;
+               perror("kvm_set_lapic");
+       }
+       return r;
+}
+
+#endif
+
+
diff --git a/libkvm/libkvm-x86.h b/libkvm/libkvm-x86.h
--- a/libkvm/libkvm-x86.h
+++ b/libkvm/libkvm-x86.h
@@ -51,4 +51,9 @@ int kvm_destroy_memory_alias(kvm_context
 int kvm_destroy_memory_alias(kvm_context_t, uint64_t phys_addr);
 
 
+#ifdef KVM_CAP_IRQCHIP
+int kvm_get_lapic(kvm_context_t kvm, int vcpu, struct kvm_lapic_state *s);
+int kvm_set_lapic(kvm_context_t kvm, int vcpu, struct kvm_lapic_state *s);
 #endif
+
+#endif
diff --git a/libkvm/libkvm.c b/libkvm/libkvm.c
--- a/libkvm/libkvm.c
+++ b/libkvm/libkvm.c
@@ -532,32 +532,6 @@ int kvm_set_irqchip(kvm_context_t kvm, s
        if (r == -1) {
                r = -errno;
                perror("kvm_set_irqchip\n");
-       }
-       return r;
-}
-
-int kvm_get_lapic(kvm_context_t kvm, int vcpu, struct kvm_lapic_state *s)
-{
-       int r;
-       if (!kvm->irqchip_in_kernel)
-               return 0;
-       r = ioctl(kvm->vcpu_fd[vcpu], KVM_GET_LAPIC, s);
-       if (r == -1) {
-               r = -errno;
-               perror("kvm_get_lapic");
-       }
-       return r;
-}
-
-int kvm_set_lapic(kvm_context_t kvm, int vcpu, struct kvm_lapic_state *s)
-{
-       int r;
-       if (!kvm->irqchip_in_kernel)
-               return 0;
-       r = ioctl(kvm->vcpu_fd[vcpu], KVM_SET_LAPIC, s);
-       if (r == -1) {
-               r = -errno;
-               perror("kvm_set_lapic");
        }
        return r;
 }

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel

Reply via email to