public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Jerone Young <jyoung5-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
To: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
Cc: kvm-ppc-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
Subject: [PATCH 08 of 20] Move kvm_destroy_phys_mem to libkvm-x86.c
Date: Fri, 02 Nov 2007 05:36:44 -0500	[thread overview]
Message-ID: <baaa6c2233371bba2d1d.1193999804@thinkpad> (raw)
In-Reply-To: <patchbomb.1193999796@thinkpad>

# HG changeset patch
# User Jerone Young <jyoung5-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
# Date 1193998499 18000
# Node ID baaa6c2233371bba2d1d67a839747576c013bbe4
# Parent  9ac9f734ec73ca1b5f156250c69741ee2a642718
Move kvm_destroy_phys_mem to libkvm-x86.c

Signed-off-by: Jerone Young <jyoung5-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>

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/

  parent reply	other threads:[~2007-11-02 10:36 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-02 10:36 [PATCH 00 of 20] [RESEND] Refactor libkvm code Phase 1 Jerone Young
2007-11-02 10:36 ` [PATCH 01 of 20] Move kvm_context to kvmctl.h Jerone Young
2007-11-02 17:28   ` [kvm-ppc-devel] " Hollis Blanchard
2007-11-02 17:42     ` Jerone Young
2007-11-02 10:36 ` [PATCH 02 of 20] Make static slot & kvm_memory region funcions public Jerone Young
2007-11-02 10:36 ` [PATCH 03 of 20] Move fuction kvm_alloc_kernel_memory to libkvm-x86.c Jerone Young
2007-11-02 10:36 ` [PATCH 04 of 20] Move kvm_alloc_userspace_memory " Jerone Young
2007-11-02 10:36 ` [PATCH 05 of 20] Modify out arch specific code from kvm_create function Jerone Young
2007-11-02 10:36 ` [PATCH 06 of 20] Move kvm_create_kernel_phys_mem to libkvm-x86.c Jerone Young
2007-11-02 10:36 ` [PATCH 07 of 20] Move kvm_create_phys_mem " Jerone Young
2007-11-02 10:36 ` Jerone Young [this message]
2007-11-02 10:36 ` [PATCH 09 of 20] Move kvm_create_memory_alias & kvm_destroy_memory_alias " Jerone Young
2007-11-02 10:36 ` [PATCH 10 of 20] Move kvm_get & kmv_set_lapci functions " Jerone Young
2007-11-02 10:36 ` [PATCH 11 of 20] Make functions in libkvm.c nonstatic Jerone Young
2007-11-02 10:36 ` [PATCH 12 of 20] Move abi 10 functions to libkvm-x86.c Jerone Young
2007-11-02 10:36 ` [PATCH 13 of 20] Move msrs " Jerone Young
2007-11-02 10:36 ` [PATCH 14 of 20] Move print_seg & Move kvm_show_regs to kvmctl-x86.c Jerone Young
2007-11-02 10:36 ` [PATCH 15 of 20] Declare kvm_abi as a global variable in libkvm.h Jerone Young
2007-11-02 10:36 ` [PATCH 16 of 20] Move kvm_get_apic to libkvm-x86.c Jerone Young
2007-11-02 10:36 ` [PATCH 17 of 20] Move cr8 functions " Jerone Young
2007-11-02 10:36 ` [PATCH 18 of 20] Move kvm_setup_cpuid " Jerone Young
2007-11-02 10:36 ` [PATCH 19 of 20] Move kvm_show_code " Jerone Young
2007-11-02 10:36 ` [PATCH 20 of 20] Remove unsued inclusion of linux/kvm_parah.h in userspace libkvm.h Jerone Young

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=baaa6c2233371bba2d1d.1193999804@thinkpad \
    --to=jyoung5-r/jw6+rmf7hqt0dzr+alfa@public.gmane.org \
    --cc=kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
    --cc=kvm-ppc-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox