diff options
author | Andreas Färber <afaerber@suse.de> | 2012-12-17 06:38:45 +0100 |
---|---|---|
committer | Andreas Färber <afaerber@suse.de> | 2013-01-15 04:09:13 +0100 |
commit | 504134d27f15aa94f6d2b5c45eaa804a8dfb5a4c (patch) | |
tree | 0e8d9bd270b459c1a8077ab71c2dec9ada8e58c5 | |
parent | 55e5c2850293547203874098f7cec148ffd12dfa (diff) |
kvm: Pass CPUState to kvm_init_vcpu()
CPUArchState is no longer needed, and it thereby no longer depends on
NEED_CPU_H.
Signed-off-by: Andreas Färber <afaerber@suse.de>
-rw-r--r-- | cpus.c | 2 | ||||
-rw-r--r-- | include/sysemu/kvm.h | 5 | ||||
-rw-r--r-- | kvm-all.c | 3 | ||||
-rw-r--r-- | kvm-stub.c | 2 |
4 files changed, 6 insertions, 6 deletions
@@ -742,7 +742,7 @@ static void *qemu_kvm_cpu_thread_fn(void *arg) cpu->thread_id = qemu_get_thread_id(); cpu_single_env = env; - r = kvm_init_vcpu(env); + r = kvm_init_vcpu(cpu); if (r < 0) { fprintf(stderr, "kvm_init_vcpu failed: %s\n", strerror(-r)); exit(1); diff --git a/include/sysemu/kvm.h b/include/sysemu/kvm.h index 3db19ffdac..2fe8f8a44b 100644 --- a/include/sysemu/kvm.h +++ b/include/sysemu/kvm.h @@ -17,6 +17,7 @@ #include <errno.h> #include "config-host.h" #include "qemu/queue.h" +#include "qom/cpu.h" #ifdef CONFIG_KVM #include <linux/kvm.h> @@ -120,9 +121,9 @@ int kvm_has_many_ioeventfds(void); int kvm_has_gsi_routing(void); int kvm_has_intx_set_mask(void); -#ifdef NEED_CPU_H -int kvm_init_vcpu(CPUArchState *env); +int kvm_init_vcpu(CPUState *cpu); +#ifdef NEED_CPU_H int kvm_cpu_exec(CPUArchState *env); #if !defined(CONFIG_USER_ONLY) @@ -214,9 +214,8 @@ static void kvm_reset_vcpu(void *opaque) kvm_arch_reset_vcpu(cpu); } -int kvm_init_vcpu(CPUArchState *env) +int kvm_init_vcpu(CPUState *cpu) { - CPUState *cpu = ENV_GET_CPU(env); KVMState *s = kvm_state; long mmap_size; int ret; diff --git a/kvm-stub.c b/kvm-stub.c index 81f8967180..47f8dca7d5 100644 --- a/kvm-stub.c +++ b/kvm-stub.c @@ -24,7 +24,7 @@ bool kvm_irqfds_allowed; bool kvm_msi_via_irqfd_allowed; bool kvm_gsi_routing_allowed; -int kvm_init_vcpu(CPUArchState *env) +int kvm_init_vcpu(CPUState *cpu) { return -ENOSYS; } |