diff options
-rw-r--r-- | main-loop.c | 2 | ||||
-rw-r--r-- | main-loop.h | 12 | ||||
-rw-r--r-- | qemu-tool.c | 3 | ||||
-rw-r--r-- | vl.c | 5 |
4 files changed, 20 insertions, 2 deletions
diff --git a/main-loop.c b/main-loop.c index 62d95b9637..db23de0497 100644 --- a/main-loop.c +++ b/main-loop.c @@ -199,7 +199,7 @@ static int qemu_signal_init(void) } #endif -int qemu_init_main_loop(void) +int main_loop_init(void) { int ret; diff --git a/main-loop.h b/main-loop.h index f9710136c9..4987041ce7 100644 --- a/main-loop.h +++ b/main-loop.h @@ -41,10 +41,22 @@ * SIGUSR2, thread signals (SIGFPE, SIGILL, SIGSEGV, SIGBUS) and real-time * signals if available. Remember that Windows in practice does not have * signals, though. + * + * In the case of QEMU tools, this will also start/initialize timers. */ int qemu_init_main_loop(void); /** + * main_loop_init: Initializes main loop + * + * Internal (but shared for compatibility reasons) initialization routine + * for the main loop. This should not be used by applications directly, + * use qemu_init_main_loop() instead. + * + */ +int main_loop_init(void); + +/** * main_loop_wait: Run one iteration of the main loop. * * If @nonblocking is true, poll for events, otherwise suspend until diff --git a/qemu-tool.c b/qemu-tool.c index 6b69668258..183a583fec 100644 --- a/qemu-tool.c +++ b/qemu-tool.c @@ -83,11 +83,12 @@ void qemu_clock_warp(QEMUClock *clock) { } -static void __attribute__((constructor)) init_main_loop(void) +int qemu_init_main_loop(void) { init_clocks(); init_timer_alarm(); qemu_clock_enable(vm_clock, false); + return main_loop_init(); } void slirp_select_fill(int *pnfds, fd_set *readfds, @@ -2167,6 +2167,11 @@ static void free_and_trace(gpointer mem) free(mem); } +int qemu_init_main_loop(void) +{ + return main_loop_init(); +} + int main(int argc, char **argv, char **envp) { const char *gdbstub_dev = NULL; |