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 --- vl.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'vl.c') diff --git a/vl.c b/vl.c index 2fb09f5012..9128d48fea 100644 --- a/vl.c +++ b/vl.c @@ -185,7 +185,6 @@ int mem_prealloc = 0; /* force preallocation of physical target memory */ #endif int nb_nics; NICInfo nd_table[MAX_NICS]; -int vm_running; int autostart; static int rtc_utc = 1; static int rtc_date_offset = -1; /* -1 means no change */ @@ -407,6 +406,11 @@ void runstate_set(RunState new_state) current_run_state = new_state; } +int runstate_is_running(void) +{ + return runstate_check(RSTATE_RUNNING); +} + /***********************************************************/ /* real time host monotonic timer */ @@ -1243,9 +1247,8 @@ void vm_state_notify(int running, RunState state) void vm_start(void) { - if (!vm_running) { + if (!runstate_is_running()) { cpu_enable_ticks(); - vm_running = 1; runstate_set(RSTATE_RUNNING); vm_state_notify(1, RSTATE_RUNNING); resume_all_vcpus(); -- cgit v1.2.1