diff mbox

[2/3] change pre and post kvm_run signatures.

Message ID 1255958444-18259-3-git-send-email-glommer@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Glauber Costa Oct. 19, 2009, 1:20 p.m. UTC
None
diff mbox

Patch

diff --git a/qemu-kvm-x86.c b/qemu-kvm-x86.c
index 350e5fd..b9ffabb 100644
--- a/qemu-kvm-x86.c
+++ b/qemu-kvm-x86.c
@@ -1329,13 +1329,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;
 
@@ -1344,6 +1345,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 ad00560..a883a48 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 06507a6..b84fed1 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);