From: Eduardo Habkost <ehabkost@redhat.com>
To: qemu-devel@nongnu.org, Paolo Bonzini <pbonzini@redhat.com>
Cc: Markus Armbruster <armbru@redhat.com>
Subject: [Qemu-devel] [PATCH 5/6] main-loop: Make qemu_init_main_loop() and qemu_signal_init() void
Date: Thu, 12 May 2016 11:10:03 -0300 [thread overview]
Message-ID: <1463062204-20330-6-git-send-email-ehabkost@redhat.com> (raw)
In-Reply-To: <1463062204-20330-1-git-send-email-ehabkost@redhat.com>
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 --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;
--
2.5.5
next prev parent reply other threads:[~2016-05-12 14:10 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-12 14:09 [Qemu-devel] [PATCH 0/6] Use &error_fatal in some initialization code Eduardo Habkost
2016-05-12 14:09 ` [Qemu-devel] [PATCH 1/6] vl: Use &error_fatal when parsing VNC options Eduardo Habkost
2016-05-12 14:10 ` [Qemu-devel] [PATCH 2/6] vl: Use &error_fatal when parsing monitor options Eduardo Habkost
2016-05-12 14:10 ` [Qemu-devel] [PATCH 3/6] main-loop: Use Error** to report qemu_signal_init() errors Eduardo Habkost
2016-05-12 14:10 ` [Qemu-devel] [PATCH 4/6] main-loop: Use &error_fatal when calling qemu_init_main_loop() Eduardo Habkost
2016-05-12 14:10 ` Eduardo Habkost [this message]
2016-05-12 14:10 ` [Qemu-devel] [PATCH 6/6] Use &error_fatal when initializing crypto on qemu-{img, io, nbd} Eduardo Habkost
2016-05-12 16:48 ` [Qemu-devel] [PATCH 0/6] Use &error_fatal in some initialization code Paolo Bonzini
2016-05-12 17:04 ` Eduardo Habkost
2016-05-16 14:25 ` Paolo Bonzini
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1463062204-20330-6-git-send-email-ehabkost@redhat.com \
--to=ehabkost@redhat.com \
--cc=armbru@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).