# HG changeset patch
# User Jerone Young <[EMAIL PROTECTED]>
# Date 1193998499 18000
# Node ID baaa6c2233371bba2d1d67a839747576c013bbe4
# Parent  9ac9f734ec73ca1b5f156250c69741ee2a642718
Move kvm_destroy_phys_mem to libkvm-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
@@ -323,3 +323,29 @@ void *kvm_create_phys_mem(kvm_context_t 
                                                                log, writable);
 }
 
+/* destroy/free a whole slot.
+ * phys_start, len and slot are the params passed to kvm_create_phys_mem()
+ */
+void kvm_destroy_phys_mem(kvm_context_t kvm, unsigned long phys_start, 
+                         unsigned long len)
+{
+       int slot;
+       struct kvm_memory_region *mem;
+
+       slot = get_slot(phys_start);
+
+       if (slot >= KVM_MAX_NUM_MEM_REGIONS) {
+               fprintf(stderr, "BUG: %s: invalid parameters (slot=%d)\n",
+                       __FUNCTION__, slot);
+               return;
+       }
+       mem = &kvm->mem_regions[slot];
+       if (phys_start != mem->guest_phys_addr) {
+               fprintf(stderr,
+                       "WARNING: %s: phys_start is 0x%lx expecting 0x%llx\n",
+                       __FUNCTION__, phys_start, mem->guest_phys_addr);
+               phys_start = mem->guest_phys_addr;
+       }
+       kvm_create_phys_mem(kvm, phys_start, 0, 0, 0);
+}
+
diff --git a/libkvm/libkvm-x86.h b/libkvm/libkvm-x86.h
new file mode 100644
--- /dev/null
+++ b/libkvm/libkvm-x86.h
@@ -0,0 +1,14 @@
+/* This header is for x86 functions & variables that will be exposed to users.
+ * DO NOT PLACE FUNCTIONS OR VARIABLES HERE THAT ARE NOT GOING TO EXPOSED TO 
+ * USERS.
+ */
+#ifndef LIBKVM_X86_H
+#define LIBKVM_X86_H
+
+void *kvm_create_phys_mem(kvm_context_t, unsigned long phys_start, 
+                         unsigned long len, int log, int writable);
+
+void kvm_destroy_phys_mem(kvm_context_t, unsigned long phys_start,
+                       unsigned long len);
+
+#endif
diff --git a/libkvm/libkvm.c b/libkvm/libkvm.c
--- a/libkvm/libkvm.c
+++ b/libkvm/libkvm.c
@@ -447,33 +447,6 @@ int kvm_register_userspace_phys_mem(kvm_
 #else
        return -ENOSYS;
 #endif
-}
-
-
-/* destroy/free a whole slot.
- * phys_start, len and slot are the params passed to kvm_create_phys_mem()
- */
-void kvm_destroy_phys_mem(kvm_context_t kvm, unsigned long phys_start, 
-                         unsigned long len)
-{
-       int slot;
-       struct kvm_memory_region *mem;
-
-       slot = get_slot(phys_start);
-
-       if (slot >= KVM_MAX_NUM_MEM_REGIONS) {
-               fprintf(stderr, "BUG: %s: invalid parameters (slot=%d)\n",
-                       __FUNCTION__, slot);
-               return;
-       }
-       mem = &kvm->mem_regions[slot];
-       if (phys_start != mem->guest_phys_addr) {
-               fprintf(stderr,
-                       "WARNING: %s: phys_start is 0x%lx expecting 0x%llx\n",
-                       __FUNCTION__, phys_start, mem->guest_phys_addr);
-               phys_start = mem->guest_phys_addr;
-       }
-       kvm_create_phys_mem(kvm, phys_start, 0, 0, 0);
 }
 
 int kvm_create_memory_alias(kvm_context_t kvm,

-------------------------------------------------------------------------
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