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>
This commit is contained in:
Luiz Capitulino 2011-07-29 15:36:43 -03:00
parent 1bcef683bf
commit 1354869c38
14 changed files with 29 additions and 27 deletions

9
vl.c
View file

@ -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();