[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 17/42] main_loop: Make main_loop_wait() return void
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PULL 17/42] main_loop: Make main_loop_wait() return void |
Date: |
Wed, 5 Jul 2017 09:14:20 +0200 |
From: Peter Maydell <address@hidden>
The last users of main_loop_wait() that cared about the return value
have now been changed to no longer use it. Drop the now-useless return
value and make the function return void.
We avoid the awkwardness of ifdeffery to handle the 'ret'
variable in main_loop_wait() only being wanted if CONFIG_SLIRP
by simply dropping all the ifdefs. There are stub implementations
of slirp_pollfds_poll() and slirp_pollfds_fill() already in
stubs/slirp.c which do nothing, as required.
Signed-off-by: Peter Maydell <address@hidden>
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
---
include/qemu/main-loop.h | 2 +-
util/main-loop.c | 8 +-------
2 files changed, 2 insertions(+), 8 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 19cad6b..2f48f41 100644
--- a/util/main-loop.c
+++ b/util/main-loop.c
@@ -487,7 +487,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;
@@ -500,9 +500,7 @@ int main_loop_wait(int nonblocking)
/* poll any events */
g_array_set_size(gpollfds, 0); /* reset for new iteration */
/* XXX: separate device handlers from system ones */
-#ifdef CONFIG_SLIRP
slirp_pollfds_fill(gpollfds, &timeout);
-#endif
if (timeout == UINT32_MAX) {
timeout_ns = -1;
@@ -515,16 +513,12 @@ int main_loop_wait(int nonblocking)
&main_loop_tlg));
ret = os_host_main_loop_wait(timeout_ns);
-#ifdef CONFIG_SLIRP
slirp_pollfds_poll(gpollfds, (ret < 0));
-#endif
/* CPU thread can infinitely wait for event after
missing the warp */
qemu_start_warp_timer();
qemu_clock_run_all_timers();
-
- return ret;
}
/* Functions to operate on the main QEMU AioContext. */
--
1.8.3.1
- [Qemu-devel] [PULL 06/42] include/exec/poison: Add some more missing TARGET and CONFIG defines, (continued)
- [Qemu-devel] [PULL 06/42] include/exec/poison: Add some more missing TARGET and CONFIG defines, Paolo Bonzini, 2017/07/05
- [Qemu-devel] [PULL 05/42] target/i386: simplify handling of conforming code segments on interrupt, Paolo Bonzini, 2017/07/05
- [Qemu-devel] [PULL 01/42] vcpu_dirty: share the same field in CPUState for all accelerators, Paolo Bonzini, 2017/07/05
- [Qemu-devel] [PULL 08/42] include/exec/poison: Mark CONFIG_KVM as poisoned, too, Paolo Bonzini, 2017/07/05
- [Qemu-devel] [PULL 07/42] Move CONFIG_KVM related definitions to kvm_i386.h, Paolo Bonzini, 2017/07/05
- [Qemu-devel] [PULL 09/42] cpu: Introduce a wrapper for tlb_flush() that can be used in common code, Paolo Bonzini, 2017/07/05
- [Qemu-devel] [PULL 15/42] util/oslib-win32: Remove if conditional, Paolo Bonzini, 2017/07/05
- [Qemu-devel] [PULL 13/42] sockets: avoid formatting buffer that may not be NUL terminated, Paolo Bonzini, 2017/07/05
- [Qemu-devel] [PULL 11/42] Makefile: Move bootdevice.o to common-obj-y, Paolo Bonzini, 2017/07/05
- [Qemu-devel] [PULL 12/42] hw/misc/edu: Compile the edu device as common object, Paolo Bonzini, 2017/07/05
- [Qemu-devel] [PULL 17/42] main_loop: Make main_loop_wait() return void,
Paolo Bonzini <=
- [Qemu-devel] [PULL 10/42] include/exec/poison: Mark CONFIG_SOFTMMU as poisoned, Paolo Bonzini, 2017/07/05
- [Qemu-devel] [PULL 18/42] checkpatch: should not use signal except for SIG_DFL or SIG_IGN, Paolo Bonzini, 2017/07/05
- [Qemu-devel] [PULL 14/42] xsave_helper: pull xsave and xrstor out of kvm.c into helper function, Paolo Bonzini, 2017/07/05
- [Qemu-devel] [PULL 16/42] tests/test-char.c: Don't use main_loop_wait()'s return value, Paolo Bonzini, 2017/07/05
- [Qemu-devel] [PULL 19/42] virtio-scsi: finalize IOMMU support, Paolo Bonzini, 2017/07/05
- [Qemu-devel] [PULL 22/42] configure: factor out list of supported Xen/KVM/HAX targets, Paolo Bonzini, 2017/07/05