aboutsummaryrefslogtreecommitdiffstats
path: root/vl.c
diff options
context:
space:
mode:
authorLuiz Capitulino <lcapitulino@redhat.com>2009-06-09 18:24:57 -0300
committerBlue Swirl <blauwirbel@gmail.com>2009-06-10 19:54:33 +0300
commitb319820d4099ec6b98c9c260e06d519fc41d544c (patch)
treed99ff73427d67d963fc043971dd5925e5858041f /vl.c
parent4590fd80b867cca0cad87ec8d3cb7be2cd56f8b4 (diff)
Fix "defined but not used" warning
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>
Diffstat (limited to 'vl.c')
-rw-r--r--vl.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/vl.c b/vl.c
index f08f0f354..69a9f918c 100644
--- a/vl.c
+++ b/vl.c
@@ -4388,6 +4388,7 @@ static int tcg_has_work(void)
static int qemu_calculate_timeout(void)
{
+#ifndef CONFIG_IOTHREAD
int timeout;
if (!vm_running)
@@ -4433,6 +4434,9 @@ static int qemu_calculate_timeout(void)
}
return timeout;
+#else /* CONFIG_IOTHREAD */
+ return 1000;
+#endif
}
static int vm_can_run(void)
@@ -4468,11 +4472,7 @@ static void main_loop(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