]> git.proxmox.com Git - mirror_qemu.git/blobdiff - vl.c
Drop the vm_running global variable
[mirror_qemu.git] / vl.c
diff --git a/vl.c b/vl.c
index 2fb09f5012704b7312ad158eec377c646289385e..9128d48fea7986c2b252473b7d37d72e82283a0a 100644 (file)
--- 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();