Patchwork [qom-next,37/59] cpus: Pass CPUState to qemu_wait_io_event_common()

login
register
mail settings
Submitter Andreas Färber
Date May 23, 2012, 3:08 a.m.
Message ID <1337742502-28565-38-git-send-email-afaerber@suse.de>
Download mbox | patch
Permalink /patch/160775/
State New
Headers show

Comments

Andreas Färber - May 23, 2012, 3:08 a.m.
CPUArchState is no longer needed there.

Signed-off-by: Andreas Färber <afaerber@suse.de>
---
 cpus.c |   12 +++++-------
 1 files changed, 5 insertions(+), 7 deletions(-)

Patch

diff --git a/cpus.c b/cpus.c
index 2e7eafb..83880e7 100644
--- a/cpus.c
+++ b/cpus.c
@@ -689,10 +689,8 @@  static void flush_queued_work(CPUState *cpu)
     qemu_cond_broadcast(&qemu_work_cond);
 }
 
-static void qemu_wait_io_event_common(CPUArchState *env)
+static void qemu_wait_io_event_common(CPUState *cpu)
 {
-    CPUState *cpu = ENV_GET_CPU(env);
-
     if (cpu->stop) {
         cpu->stop = false;
         cpu->stopped = true;
@@ -718,7 +716,7 @@  static void qemu_tcg_wait_io_event(void)
     }
 
     for (env = first_cpu; env != NULL; env = env->next_cpu) {
-        qemu_wait_io_event_common(env);
+        qemu_wait_io_event_common(ENV_GET_CPU(env));
     }
 }
 
@@ -731,7 +729,7 @@  static void qemu_kvm_wait_io_event(CPUArchState *env)
     }
 
     qemu_kvm_eat_signals(env);
-    qemu_wait_io_event_common(env);
+    qemu_wait_io_event_common(cpu);
 }
 
 static void *qemu_kvm_cpu_thread_fn(void *arg)
@@ -806,7 +804,7 @@  static void *qemu_dummy_cpu_thread_fn(void *arg)
         }
         qemu_mutex_lock_iothread();
         cpu_single_env = env;
-        qemu_wait_io_event_common(env);
+        qemu_wait_io_event_common(cpu);
     }
 
     return NULL;
@@ -838,7 +836,7 @@  static void *qemu_tcg_cpu_thread_fn(void *arg)
 
         /* process any pending work */
         for (env = first_cpu; env != NULL; env = env->next_cpu) {
-            qemu_wait_io_event_common(env);
+            qemu_wait_io_event_common(ENV_GET_CPU(env));
         }
     }