public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] [4/2] rename_kvm_cpu_cache_x86
@ 2007-11-29 10:00 Christian Ehrhardt
       [not found] ` <474E8DCF.4020609-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Christian Ehrhardt @ 2007-11-29 10:00 UTC (permalink / raw)
  To: Zhang, Xiantao, avi-atKUWr5tajBWk0Htik3J/w,
	kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f,
	carsteno-tA70FqPdS9bQT0dZR+AlfA, hollisb-r/Jw6+rmf7HQT0dZR+AlfA

From: Christian Ehrhardt <ehrhardt-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
Date: Thu, 29 Nov 2007 10:54:00 +0100
Subject: [PATCH] [4/2] rename_kvm_cpu_cache_x86

Renamed the kvm_vcpu_cache structure to kvm_x86_vcpu_cache to make clear to anyone who see's that variable in the code in future that it's x86 only.
Equivalent to perl -p -i -e "s/kvm_vcpu_cache/kvm_x86_vcpu_cache/g" drivers/kvm/*

Signed-off-by: Christian Ehrhardt <ehrhardt-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
---

[diffstat]
 svm.c |    6 +++---
 vmx.c |    6 +++---
 x86.c |   12 ++++++------
 x86.h |    2 +-
 4 files changed, 13 insertions(+), 13 deletions(-)

[diff]
diff --git a/drivers/kvm/svm.c b/drivers/kvm/svm.c
index 928fb35..d12ff34 100644
--- a/drivers/kvm/svm.c
+++ b/drivers/kvm/svm.c
@@ -578,7 +578,7 @@ static struct kvm_vcpu *svm_create_vcpu(struct kvm *kvm, unsigned int id)
 	struct page *page;
 	int err;
 
-	svm = kmem_cache_zalloc(kvm_vcpu_cache, GFP_KERNEL);
+	svm = kmem_cache_zalloc(kvm_x86_vcpu_cache, GFP_KERNEL);
 	if (!svm) {
 		err = -ENOMEM;
 		goto out;
@@ -612,7 +612,7 @@ static struct kvm_vcpu *svm_create_vcpu(struct kvm *kvm, unsigned int id)
 uninit:
 	kvm_vcpu_uninit(&svm->vcpu);
 free_svm:
-	kmem_cache_free(kvm_vcpu_cache, svm);
+	kmem_cache_free(kvm_x86_vcpu_cache, svm);
 out:
 	return ERR_PTR(err);
 }
@@ -623,7 +623,7 @@ static void svm_free_vcpu(struct kvm_vcpu *vcpu)
 
 	__free_page(pfn_to_page(svm->vmcb_pa >> PAGE_SHIFT));
 	kvm_vcpu_uninit(vcpu);
-	kmem_cache_free(kvm_vcpu_cache, svm);
+	kmem_cache_free(kvm_x86_vcpu_cache, svm);
 }
 
 static void svm_vcpu_load(struct kvm_vcpu *vcpu, int cpu)
diff --git a/drivers/kvm/vmx.c b/drivers/kvm/vmx.c
index 8e43feb..5c61cc2 100644
--- a/drivers/kvm/vmx.c
+++ b/drivers/kvm/vmx.c
@@ -2519,13 +2519,13 @@ static void vmx_free_vcpu(struct kvm_vcpu *vcpu)
 	kfree(vmx->host_msrs);
 	kfree(vmx->guest_msrs);
 	kvm_vcpu_uninit(vcpu);
-	kmem_cache_free(kvm_vcpu_cache, vmx);
+	kmem_cache_free(kvm_x86_vcpu_cache, vmx);
 }
 
 static struct kvm_vcpu *vmx_create_vcpu(struct kvm *kvm, unsigned int id)
 {
 	int err;
-	struct vcpu_vmx *vmx = kmem_cache_zalloc(kvm_vcpu_cache, GFP_KERNEL);
+	struct vcpu_vmx *vmx = kmem_cache_zalloc(kvm_x86_vcpu_cache, GFP_KERNEL);
 	int cpu;
 
 	if (!vmx)
@@ -2570,7 +2570,7 @@ free_guest_msrs:
 uninit_vcpu:
 	kvm_vcpu_uninit(&vmx->vcpu);
 free_vcpu:
-	kmem_cache_free(kvm_vcpu_cache, vmx);
+	kmem_cache_free(kvm_x86_vcpu_cache, vmx);
 	return ERR_PTR(err);
 }
 
diff --git a/drivers/kvm/x86.c b/drivers/kvm/x86.c
index b8a1b52..47de514 100644
--- a/drivers/kvm/x86.c
+++ b/drivers/kvm/x86.c
@@ -48,8 +48,8 @@
 
 struct kvm_x86_ops *kvm_x86_ops;
 
-struct kmem_cache *kvm_vcpu_cache;
-EXPORT_SYMBOL_GPL(kvm_vcpu_cache);
+struct kmem_cache *kvm_x86_vcpu_cache;
+EXPORT_SYMBOL_GPL(kvm_x86_vcpu_cache);
 
 
 struct kvm_stats_debugfs_item debugfs_entries[] = {
@@ -2012,10 +2012,10 @@ int kvm_arch_init(void *opaque, unsigned int vcpu_size,
 		goto out_fail;
 
 	/* A kmem cache lets us meet the alignment requirements of fx_save. */
-	kvm_vcpu_cache = kmem_cache_create("kvm_vcpu", vcpu_size,
+	kvm_x86_vcpu_cache = kmem_cache_create("kvm_vcpu", vcpu_size,
 					   __alignof__(struct kvm_vcpu),
 					   0, NULL);
-	if (!kvm_vcpu_cache) {
+	if (!kvm_x86_vcpu_cache) {
 		r = -ENOMEM;
 		goto out_free;
 	}
@@ -2044,7 +2044,7 @@ int kvm_arch_init(void *opaque, unsigned int vcpu_size,
 	return 0;
 
 out:
-	kmem_cache_destroy(kvm_vcpu_cache);
+	kmem_cache_destroy(kvm_x86_vcpu_cache);
 out_free:
 	kvm_mmu_module_exit();
 out_fail:
@@ -2055,7 +2055,7 @@ void kvm_arch_exit(void)
 {
 	kvm_x86_ops = NULL;
 	kvm_mmu_module_exit();
-	kmem_cache_destroy(kvm_vcpu_cache);
+	kmem_cache_destroy(kvm_x86_vcpu_cache);
 }
 
 int kvm_emulate_halt(struct kvm_vcpu *vcpu)
diff --git a/drivers/kvm/x86.h b/drivers/kvm/x86.h
index 2080a65..da73280 100644
--- a/drivers/kvm/x86.h
+++ b/drivers/kvm/x86.h
@@ -224,7 +224,7 @@ struct kvm_x86_ops {
 };
 
 extern struct kvm_x86_ops *kvm_x86_ops;
-extern struct kmem_cache *kvm_vcpu_cache;
+extern struct kmem_cache *kvm_x86_vcpu_cache;
 
 int kvm_mmu_module_init(void);
 void kvm_mmu_module_exit(void);


-- 

Grüsse / regards, 
Christian Ehrhardt

IBM Linux Technology Center, Open Virtualization
+49 7031/16-3385
Ehrhardt-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org
Ehrhardt-tA70FqPdS9bQT0dZR+AlfA@public.gmane.org

IBM Deutschland Entwicklung GmbH
Vorsitzender des Aufsichtsrats: Johann Weihen 
Geschäftsführung: Herbert Kircher 
Sitz der Gesellschaft: Böblingen
Registergericht: Amtsgericht Stuttgart, HRB 243294

-------------------------------------------------------------------------
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-11-29 12:22 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-29 10:00 [PATCH] [4/2] rename_kvm_cpu_cache_x86 Christian Ehrhardt
     [not found] ` <474E8DCF.4020609-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
2007-11-29 10:33   ` Zhang, Xiantao
2007-11-29 12:22   ` Carsten Otte

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox