# HG changeset patch # User Jerone Young <[EMAIL PROTECTED]> # 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 <[EMAIL PROTECTED]> 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 <string.h> + +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/ _______________________________________________ kvm-devel mailing list kvm-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/kvm-devel