[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 24/53] include: move coroutine IO functions to coroutine.h
From: |
Paolo Bonzini |
Subject: |
[PULL 24/53] include: move coroutine IO functions to coroutine.h |
Date: |
Tue, 19 Apr 2022 07:50:40 +0200 |
From: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20220323155743.1585078-20-marcandre.lureau@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
include/qemu-common.h | 23 -----------------------
include/qemu/coroutine.h | 23 +++++++++++++++++++++++
2 files changed, 23 insertions(+), 23 deletions(-)
diff --git a/include/qemu-common.h b/include/qemu-common.h
index 2e1e76014a..fdb0b16166 100644
--- a/include/qemu-common.h
+++ b/include/qemu-common.h
@@ -45,29 +45,6 @@ bool set_preferred_target_page_bits(int bits);
*/
void finalize_target_page_bits(void);
-/**
- * Sends a (part of) iovec down a socket, yielding when the socket is full, or
- * Receives data into a (part of) iovec from a socket,
- * yielding when there is no data in the socket.
- * The same interface as qemu_sendv_recvv(), with added yielding.
- * XXX should mark these as coroutine_fn
- */
-ssize_t qemu_co_sendv_recvv(int sockfd, struct iovec *iov, unsigned iov_cnt,
- size_t offset, size_t bytes, bool do_send);
-#define qemu_co_recvv(sockfd, iov, iov_cnt, offset, bytes) \
- qemu_co_sendv_recvv(sockfd, iov, iov_cnt, offset, bytes, false)
-#define qemu_co_sendv(sockfd, iov, iov_cnt, offset, bytes) \
- qemu_co_sendv_recvv(sockfd, iov, iov_cnt, offset, bytes, true)
-
-/**
- * The same as above, but with just a single buffer
- */
-ssize_t qemu_co_send_recv(int sockfd, void *buf, size_t bytes, bool do_send);
-#define qemu_co_recv(sockfd, buf, bytes) \
- qemu_co_send_recv(sockfd, buf, bytes, false)
-#define qemu_co_send(sockfd, buf, bytes) \
- qemu_co_send_recv(sockfd, buf, bytes, true)
-
void qemu_progress_init(int enabled, float min_skip);
void qemu_progress_end(void);
void qemu_progress_print(float delta, int max);
diff --git a/include/qemu/coroutine.h b/include/qemu/coroutine.h
index c828a95ee0..284571badb 100644
--- a/include/qemu/coroutine.h
+++ b/include/qemu/coroutine.h
@@ -343,4 +343,27 @@ void qemu_coroutine_decrease_pool_batch_size(unsigned int
additional_pool_size);
#include "qemu/lockable.h"
+/**
+ * Sends a (part of) iovec down a socket, yielding when the socket is full, or
+ * Receives data into a (part of) iovec from a socket,
+ * yielding when there is no data in the socket.
+ * The same interface as qemu_sendv_recvv(), with added yielding.
+ * XXX should mark these as coroutine_fn
+ */
+ssize_t qemu_co_sendv_recvv(int sockfd, struct iovec *iov, unsigned iov_cnt,
+ size_t offset, size_t bytes, bool do_send);
+#define qemu_co_recvv(sockfd, iov, iov_cnt, offset, bytes) \
+ qemu_co_sendv_recvv(sockfd, iov, iov_cnt, offset, bytes, false)
+#define qemu_co_sendv(sockfd, iov, iov_cnt, offset, bytes) \
+ qemu_co_sendv_recvv(sockfd, iov, iov_cnt, offset, bytes, true)
+
+/**
+ * The same as above, but with just a single buffer
+ */
+ssize_t qemu_co_send_recv(int sockfd, void *buf, size_t bytes, bool do_send);
+#define qemu_co_recv(sockfd, buf, bytes) \
+ qemu_co_send_recv(sockfd, buf, bytes, false)
+#define qemu_co_send(sockfd, buf, bytes) \
+ qemu_co_send_recv(sockfd, buf, bytes, true)
+
#endif /* QEMU_COROUTINE_H */
--
2.35.1
- Re: [PULL 01/53] qapi, target/i386/sev: Add cpu0-id to query-sev-capabilities, (continued)
- [PULL 11/53] Replace config-time define HOST_WORDS_BIGENDIAN, Paolo Bonzini, 2022/04/19
- [PULL 20/53] error-report: use error_printf() for program prefix, Paolo Bonzini, 2022/04/19
- [PULL 23/53] include: move qemu_pipe() to osdep.h, Paolo Bonzini, 2022/04/19
- [PULL 06/53] meson: use chardev_ss dependencies, Paolo Bonzini, 2022/04/19
- [PULL 07/53] meson: add util dependency for oslib-posix on freebsd, Paolo Bonzini, 2022/04/19
- [PULL 16/53] Replace qemu_real_host_page variables with inlined functions, Paolo Bonzini, 2022/04/19
- [PULL 14/53] include/qapi: add g_autoptr support for qobject types, Paolo Bonzini, 2022/04/19
- [PULL 19/53] util: rename qemu-error.c to match its header name, Paolo Bonzini, 2022/04/19
- [PULL 21/53] include: move TFR to osdep.h, Paolo Bonzini, 2022/04/19
- [PULL 24/53] include: move coroutine IO functions to coroutine.h,
Paolo Bonzini <=
- [PULL 27/53] include: move cpu_exec* declarations to cpu-common.h, Paolo Bonzini, 2022/04/19
- [PULL 37/53] build-sys: drop ntddscsi.h check, Paolo Bonzini, 2022/04/19
- [PULL 38/53] build-sys: simplify AF_VSOCK check, Paolo Bonzini, 2022/04/19
- [PULL 41/53] thread-posix: use monotonic clock for QemuCond and QemuSemaphore, Paolo Bonzini, 2022/04/19
- [PULL 40/53] thread-posix: remove the posix semaphore support, Paolo Bonzini, 2022/04/19
- [PULL 44/53] hyperv: SControl is optional to enable SynIc, Paolo Bonzini, 2022/04/19
- [PULL 52/53] target/i386: do not access beyond the low 128 bits of SSE registers, Paolo Bonzini, 2022/04/19
- [PULL 30/53] include: move qemu_get_vm_name() to sysemu.h, Paolo Bonzini, 2022/04/19
- [PULL 05/53] oslib: drop qemu_gettimeofday(), Paolo Bonzini, 2022/04/19
- [PULL 03/53] qga: replace qemu_gettimeofday() with g_get_real_time(), Paolo Bonzini, 2022/04/19