提交 8e1b90ec 编写于 作者: J Jan Kiszka 提交者: Marcelo Tosatti

Leave inner main_loop faster on pending requests

If there is any pending request that requires us to leave the inner loop
if main_loop, makes sure we do this as soon as possible by enforcing
non-blocking IO processing.

At this change, move variable definitions out of the inner loop to
improve readability.
Signed-off-by: NJan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: NMarcelo Tosatti <mtosatti@redhat.com>
上级 38145df2
无相关合并请求
......@@ -1402,18 +1402,21 @@ qemu_irq qemu_system_powerdown;
static void main_loop(void)
{
bool nonblocking = false;
#ifdef CONFIG_PROFILER
int64_t ti;
#endif
int r;
qemu_main_loop_start();
for (;;) {
do {
bool nonblocking = false;
#ifdef CONFIG_PROFILER
int64_t ti;
#endif
#ifndef CONFIG_IOTHREAD
nonblocking = cpu_exec_all();
if (!vm_can_run()) {
nonblocking = true;
}
#endif
#ifdef CONFIG_PROFILER
ti = profile_getclock();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册
反馈
建议
客服 返回
顶部