aboutsummaryrefslogtreecommitdiff
path: root/cpus.c
diff options
context:
space:
mode:
authorLuiz Capitulino <lcapitulino@redhat.com>2011-07-29 15:36:43 -0300
committerLuiz Capitulino <lcapitulino@redhat.com>2011-09-15 16:39:32 -0300
commit1354869c380cf4560fa3f0520e914cb5ee380ac8 (patch)
treeda76e4d2063b81905a66a8446d9301bd910ee856 /cpus.c
parent1bcef683bf840a928d633755031ac572d5fdb851 (diff)
Drop the vm_running global variable
Use runstate_is_running() instead, which is introduced by this commit. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Diffstat (limited to 'cpus.c')
-rw-r--r--cpus.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/cpus.c b/cpus.c
index 3444bc06e7..883c27ac9a 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) ||