From: Peter Maydell <peter.maydell@linaro.org>
To: qemu-devel@nongnu.org
Cc: patches@linaro.org, Paolo Bonzini <pbonzini@redhat.com>
Subject: [Qemu-devel] [PATCH] main_loop: Make main_loop_wait() return void
Date: Fri, 31 Mar 2017 14:51:49 +0100 [thread overview]
Message-ID: <1490968309-13672-1-git-send-email-peter.maydell@linaro.org> (raw)
In commit e330c118f2a5a the last usage of main_loop_wait() that cared
about the return value was changed to no longer use it. Drop the
now-useless return value and make the function return void.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
Coverity complains (CID 1372464) about main_loop() calling
main_loop_wait() and ignoring its return value. I suspect
this change will just displace that to within main_loop_wait()
itself since the underlying issue there is "the ppoll() that
gets called to poll fds can return an error code, but what
do we do if it does?". Suggestions on that point welcome.
I guess this will make the compiler warn about ret being
set and never used if CONFIG_SLIRP is not defined, which
is irritating. I'm postponing messing about with fixing
that in favour of seeing whether anybody has a good answer
to the question above (which might make it moot).
---
include/qemu/main-loop.h | 2 +-
util/main-loop.c | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/include/qemu/main-loop.h b/include/qemu/main-loop.h
index d7e24af..6b4b60b 100644
--- a/include/qemu/main-loop.h
+++ b/include/qemu/main-loop.h
@@ -79,7 +79,7 @@ int qemu_init_main_loop(Error **errp);
*
* @nonblocking: Whether the caller should block until an event occurs.
*/
-int main_loop_wait(int nonblocking);
+void main_loop_wait(int nonblocking);
/**
* qemu_get_aio_context: Return the main loop's AioContext
diff --git a/util/main-loop.c b/util/main-loop.c
index 4534c89..d0e27f3 100644
--- a/util/main-loop.c
+++ b/util/main-loop.c
@@ -476,7 +476,7 @@ static int os_host_main_loop_wait(int64_t timeout)
}
#endif
-int main_loop_wait(int nonblocking)
+void main_loop_wait(int nonblocking)
{
int ret;
uint32_t timeout = UINT32_MAX;
@@ -513,7 +513,7 @@ int main_loop_wait(int nonblocking)
qemu_start_warp_timer();
qemu_clock_run_all_timers();
- return ret;
+ return;
}
/* Functions to operate on the main QEMU AioContext. */
--
2.7.4
next reply other threads:[~2017-03-31 13:51 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-31 13:51 Peter Maydell [this message]
2017-03-31 13:54 ` [Qemu-devel] [PATCH] main_loop: Make main_loop_wait() return void Peter Maydell
2017-03-31 14:10 ` Eric Blake
2017-05-30 14:08 ` Peter Maydell
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=1490968309-13672-1-git-send-email-peter.maydell@linaro.org \
--to=peter.maydell@linaro.org \
--cc=patches@linaro.org \
--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).