@@ -42,7 +42,7 @@
*
* In the case of QEMU tools, this will also start/initialize timers.
*/
-int qemu_init_main_loop(Error **errp);
+void qemu_init_main_loop(Error **errp);
/**
* main_loop_wait: Run one iteration of the main loop.
@@ -71,7 +71,7 @@ static void sigfd_handler(void *opaque)
}
}
-static int qemu_signal_init(Error **errp)
+static void qemu_signal_init(Error **errp)
{
int sigfd;
sigset_t set;
@@ -97,21 +97,18 @@ static int qemu_signal_init(Error **errp)
sigfd = qemu_signalfd(&set);
if (sigfd == -1) {
error_setg_errno(errp, errno, "failed to create signalfd");
- return -errno;
+ return;
}
fcntl_setfl(sigfd, O_NONBLOCK);
qemu_set_fd_handler(sigfd, sigfd_handler, NULL, (void *)(intptr_t)sigfd);
-
- return 0;
}
#else /* _WIN32 */
-static int qemu_signal_init(Error **errp)
+static void qemu_signal_init(Error **errp)
{
- return 0;
}
#endif
@@ -140,25 +137,24 @@ void qemu_notify_event(void)
static GArray *gpollfds;
-int qemu_init_main_loop(Error **errp)
+void qemu_init_main_loop(Error **errp)
{
- int ret;
GSource *src;
Error *local_error = NULL;
init_clocks();
- ret = qemu_signal_init(&local_error);
- if (ret) {
+ qemu_signal_init(&local_error);
+ if (local_error) {
error_propagate(errp, local_error);
- return ret;
+ return;
}
qemu_aio_context = aio_context_new(&local_error);
qemu_notify_bh = qemu_bh_new(notify_event_cb, NULL);
if (!qemu_aio_context) {
error_propagate(errp, local_error);
- return -EMFILE;
+ return;
}
gpollfds = g_array_new(FALSE, FALSE, sizeof(GPollFD));
src = aio_get_g_source(qemu_aio_context);
@@ -167,7 +163,6 @@ int qemu_init_main_loop(Error **errp)
src = iohandler_get_g_source();
g_source_attach(src, NULL);
g_source_unref(src);
- return 0;
}
static int max_priority;
Their return values are not used by their callers anymore, so the functions can be void. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> --- include/qemu/main-loop.h | 2 +- main-loop.c | 21 ++++++++------------- 2 files changed, 9 insertions(+), 14 deletions(-)