From 1354869c380cf4560fa3f0520e914cb5ee380ac8 Mon Sep 17 00:00:00 2001 From: Luiz Capitulino Date: Fri, 29 Jul 2011 15:36:43 -0300 Subject: Drop the vm_running global variable Use runstate_is_running() instead, which is introduced by this commit. Signed-off-by: Luiz Capitulino --- cpus.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'cpus.c') diff --git a/cpus.c b/cpus.c index 3444bc06e..883c27ac9 100644 --- a/cpus.c +++ b/cpus.c @@ -115,14 +115,13 @@ void cpu_synchronize_all_post_init(void) int cpu_is_stopped(CPUState *env) { - return !vm_running || env->stopped; + return !runstate_is_running() || env->stopped; } static void do_vm_stop(RunState state) { - if (vm_running) { + if (runstate_is_running()) { cpu_disable_ticks(); - vm_running = 0; pause_all_vcpus(); runstate_set(state); vm_state_notify(0, state); @@ -137,7 +136,7 @@ static int cpu_can_run(CPUState *env) if (env->stop) { return 0; } - if (env->stopped || !vm_running) { + if (env->stopped || !runstate_is_running()) { return 0; } return 1; @@ -148,7 +147,7 @@ static bool cpu_thread_is_idle(CPUState *env) if (env->stop || env->queued_work_first) { return false; } - if (env->stopped || !vm_running) { + if (env->stopped || !runstate_is_running()) { return true; } if (!env->halted || qemu_cpu_has_work(env) || -- cgit v1.2.3