提交 3a720b14 编写于 作者: P Paolo Bonzini 提交者: Anthony Liguori

remove qemu_rearm_alarm_timer from main loop

Make the timer subsystem register its own callback instead.
Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
上级 1db89e91
......@@ -1417,6 +1417,12 @@ static void win32_rearm_timer(struct qemu_alarm_timer *t)
#endif /* _WIN32 */
static void alarm_timer_on_change_state_rearm(void *opaque, int running, int reason)
{
if (running)
qemu_rearm_alarm_timer((struct qemu_alarm_timer *) opaque);
}
static int init_timer_alarm(void)
{
struct qemu_alarm_timer *t = NULL;
......@@ -1438,6 +1444,7 @@ static int init_timer_alarm(void)
/* first event is at time 0 */
t->pending = 1;
alarm_timer = t;
qemu_add_vm_change_state_handler(alarm_timer_on_change_state_rearm, t);
return 0;
......@@ -3080,7 +3087,6 @@ void vm_start(void)
cpu_enable_ticks();
vm_running = 1;
vm_state_notify(1, 0);
qemu_rearm_alarm_timer(alarm_timer);
resume_all_vcpus();
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册