summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGlauber Costa <glommer@redhat.com>2009-10-19 11:20:43 -0200
committerMarcelo Tosatti <mtosatti@redhat.com>2009-10-20 12:59:03 -0200
commitae3c812ede5273bbbbd6d626fade5959ea16530d (patch)
tree812c1b7f3d8f5a5d001e462f675b1bda247064b6
parentuse handle_io upstream version. (diff)
downloadqemu-kvm-ae3c812ede5273bbbbd6d626fade5959ea16530d.tar.gz
qemu-kvm-ae3c812ede5273bbbbd6d626fade5959ea16530d.tar.bz2
qemu-kvm-ae3c812ede5273bbbbd6d626fade5959ea16530d.zip
change pre and post kvm_run signatures.
Intention is to merge with upstream version in the following patch. Doing as a separate step to help identify any further issues. Signed-off-by: Glauber Costa <glommer@redhat.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
-rw-r--r--qemu-kvm-x86.c6
-rw-r--r--qemu-kvm.c4
-rw-r--r--qemu-kvm.h4
3 files changed, 8 insertions, 6 deletions
diff --git a/qemu-kvm-x86.c b/qemu-kvm-x86.c
index fb70edeb5..f4d9e7a7c 100644
--- a/qemu-kvm-x86.c
+++ b/qemu-kvm-x86.c
@@ -1410,13 +1410,14 @@ int kvm_arch_halt(CPUState *env)
return 1;
}
-void kvm_arch_pre_kvm_run(void *opaque, CPUState *env)
+int kvm_arch_pre_run(CPUState *env, struct kvm_run *run)
{
if (!kvm_irqchip_in_kernel())
kvm_set_cr8(env, cpu_get_apic_tpr(env));
+ return 0;
}
-void kvm_arch_post_kvm_run(void *opaque, CPUState *env)
+int kvm_arch_post_run(CPUState *env, struct kvm_run *run)
{
cpu_single_env = env;
@@ -1425,6 +1426,7 @@ void kvm_arch_post_kvm_run(void *opaque, CPUState *env)
cpu_set_apic_tpr(env, kvm_get_cr8(env));
cpu_set_apic_base(env, kvm_get_apic_base(env));
+ return 0;
}
int kvm_arch_has_work(CPUState *env)
diff --git a/qemu-kvm.c b/qemu-kvm.c
index 9f2a153ab..c58ad304e 100644
--- a/qemu-kvm.c
+++ b/qemu-kvm.c
@@ -852,12 +852,12 @@ static inline void push_nmi(kvm_context_t kvm)
void post_kvm_run(kvm_context_t kvm, CPUState *env)
{
pthread_mutex_lock(&qemu_mutex);
- kvm_arch_post_kvm_run(kvm->opaque, env);
+ kvm_arch_post_run(env, env->kvm_run);
}
int pre_kvm_run(kvm_context_t kvm, CPUState *env)
{
- kvm_arch_pre_kvm_run(kvm->opaque, env);
+ kvm_arch_pre_run(env, env->kvm_run);
pthread_mutex_unlock(&qemu_mutex);
return 0;
diff --git a/qemu-kvm.h b/qemu-kvm.h
index 525d78d1e..192ee722a 100644
--- a/qemu-kvm.h
+++ b/qemu-kvm.h
@@ -965,8 +965,8 @@ void kvm_arch_load_regs(CPUState *env);
void kvm_arch_load_mpstate(CPUState *env);
void kvm_arch_save_mpstate(CPUState *env);
int kvm_arch_init_vcpu(CPUState *cenv);
-void kvm_arch_pre_kvm_run(void *opaque, CPUState *env);
-void kvm_arch_post_kvm_run(void *opaque, CPUState *env);
+int kvm_arch_pre_run(CPUState *env, struct kvm_run *run);
+int kvm_arch_post_run(CPUState *env, struct kvm_run *run);
int kvm_arch_has_work(CPUState *env);
void kvm_arch_process_irqchip_events(CPUState *env);
int kvm_arch_try_push_interrupts(void *opaque);