From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jerone Young Subject: [PATCH 3 of 3] Move x86 specific properties of kvm_init to own file Date: Sun, 28 Oct 2007 19:42:49 -0500 Message-ID: <64de4ce84d745217a700.1193618569@thinkpad> References: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: kvm-ppc-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org To: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org Return-path: In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org Errors-To: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org List-Id: kvm.vger.kernel.org # HG changeset patch # User Jerone Young # Date 1193618393 18000 # Node ID 64de4ce84d745217a7001dd5ba8c871aa9ad533a # Parent 8bf5e4e6a4c9d2dab89062a0ab24a2ae5d144a02 Move x86 specific properties of kvm_init to own file. This patch breaks out x86 specific properties for kvm_init initialization into it's own function, into a architecture specific file. Signed-off-by: Jerone Young diff --git a/user/config-x86-common.mak b/user/config-x86-common.mak --- a/user/config-x86-common.mak +++ b/user/config-x86-common.mak @@ -2,9 +2,9 @@ all: kvmctl libkvm.a test_cases -kvmctl_objs=kvmctl.o main.o +kvmctl_objs=kvmctl-x86.o kvmctl.o main.o -libkvm_objs=kvmctl.o +libkvm_objs=kvmctl-x86.o kvmctl.o balloon_ctl: balloon_ctl.o diff --git a/user/kvmctl-x86.c b/user/kvmctl-x86.c new file mode 100644 --- /dev/null +++ b/user/kvmctl-x86.c @@ -0,0 +1,9 @@ +#include "kvmctl.h" +#include + +void arch_kvm_init(kvm_context_t kvm) +{ + kvm->dirty_pages_log_all = 0; + kvm->no_irqchip_creation = 0; + memset(&kvm->mem_regions, 0, sizeof(kvm->mem_regions)); +} diff --git a/user/kvmctl-x86.h b/user/kvmctl-x86.h --- a/user/kvmctl-x86.h +++ b/user/kvmctl-x86.h @@ -54,4 +54,11 @@ struct kvm_callbacks { void (*post_kvm_run)(void *opaque, int vcpu); int (*pre_kvm_run)(void *opaque, int vcpu); }; + +/* + * \brief Arch specific initialization for KVM context + */ +void arch_kvm_init(kvm_context_t kvm); + + #endif diff --git a/user/kvmctl.c b/user/kvmctl.c --- a/user/kvmctl.c +++ b/user/kvmctl.c @@ -231,10 +231,9 @@ kvm_context_t kvm_init(struct kvm_callba kvm->vm_fd = -1; kvm->callbacks = callbacks; kvm->opaque = opaque; - kvm->dirty_pages_log_all = 0; - kvm->no_irqchip_creation = 0; - memset(&kvm->mem_regions, 0, sizeof(kvm->mem_regions)); - + + arch_kvm_init(kvm); + return kvm; out_close: close(fd); ------------------------------------------------------------------------- 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/