diff mbox

[5/6] main-loop: Make qemu_init_main_loop() and qemu_signal_init() void

Message ID 1463062204-20330-6-git-send-email-ehabkost@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Eduardo Habkost May 12, 2016, 2:10 p.m. UTC
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(-)
diff mbox

Patch

diff --git a/include/qemu/main-loop.h b/include/qemu/main-loop.h
index 19b5de3..572cf8e 100644
--- a/include/qemu/main-loop.h
+++ b/include/qemu/main-loop.h
@@ -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.
diff --git a/main-loop.c b/main-loop.c
index 8e8eafc..90685ee 100644
--- a/main-loop.c
+++ b/main-loop.c
@@ -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;