mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 00:03:54 -06:00
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:
parent
1bcef683bf
commit
1354869c38
14 changed files with 29 additions and 27 deletions
9
vl.c
9
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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue