The function qemu_calculate_timeout() is only used when CONFIG_IOTHREAD
is not defined. When CONFIG_IOTHREAD is defined, we have the following
warning:
vl.c:4389: warning: ‘qemu_calculate_timeout’ defined but not used
This change fixes that by moving the #ifdef/#endif from main_loop()
into qemu_calculate_timeout(). This encapsulates the logic and allow
us to use qemu_calculate_timeout() when CONFIG_IOTHREAD is defined
or not (suggested by Glauber Costa).
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
static int qemu_calculate_timeout(void)
{
+#ifndef CONFIG_IOTHREAD
int timeout;
if (!vm_running)
}
return timeout;
+#else /* CONFIG_IOTHREAD */
+ return 1000;
+#endif
}
static int vm_can_run(void)
#ifdef CONFIG_PROFILER
ti = profile_getclock();
#endif
-#ifdef CONFIG_IOTHREAD
- main_loop_wait(1000);
-#else
main_loop_wait(qemu_calculate_timeout());
-#endif
#ifdef CONFIG_PROFILER
dev_time += profile_getclock() - ti;
#endif