@@ -110,7 +110,7 @@ static ssize_t mpqemu_read(QIOChannel *ioc, void *buf, size_t len, int **fds,
bql_unlock();
}
- ret = qio_channel_readv_full_all_eof(ioc, &iov, 1, fds, nfds, errp);
+ ret = qio_channel_readv_full_all_eof(ioc, &iov, 1, fds, nfds, 0, errp);
if (drop_bql && !iothread && !qemu_in_coroutine()) {
bql_lock();
@@ -298,6 +298,7 @@ ssize_t qio_channel_writev_full(QIOChannel *ioc,
* @ioc: the channel object
* @iov: the array of memory regions to read data into
* @niov: the length of the @iov array
+ * @flags: read flags (QIO_CHANNEL_READ_FLAG_*)
* @errp: pointer to a NULL-initialized error object
*
* Read data from the IO channel, storing it in the
@@ -321,6 +322,7 @@ ssize_t qio_channel_writev_full(QIOChannel *ioc,
int coroutine_mixed_fn qio_channel_readv_all_eof(QIOChannel *ioc,
const struct iovec *iov,
size_t niov,
+ int flags,
Error **errp);
/**
@@ -442,6 +444,7 @@ ssize_t qio_channel_write(QIOChannel *ioc,
* @ioc: the channel object
* @buf: the memory region to read data into
* @buflen: the number of bytes to @buf
+ * @flags: read flags (QIO_CHANNEL_READ_FLAG_*)
* @errp: pointer to a NULL-initialized error object
*
* Reads @buflen bytes into @buf, possibly blocking or (if the
@@ -457,6 +460,7 @@ ssize_t qio_channel_write(QIOChannel *ioc,
int coroutine_mixed_fn qio_channel_read_all_eof(QIOChannel *ioc,
char *buf,
size_t buflen,
+ int flags,
Error **errp);
/**
@@ -885,6 +889,7 @@ void qio_channel_set_aio_fd_handler(QIOChannel *ioc,
* @niov: the length of the @iov array
* @fds: an array of file handles to read
* @nfds: number of file handles in @fds
+ * @flags: read flags (QIO_CHANNEL_READ_FLAG_*)
* @errp: pointer to a NULL-initialized error object
*
*
@@ -903,6 +908,7 @@ int coroutine_mixed_fn qio_channel_readv_full_all_eof(QIOChannel *ioc,
const struct iovec *iov,
size_t niov,
int **fds, size_t *nfds,
+ int flags,
Error **errp);
/**
@@ -113,9 +113,11 @@ ssize_t qio_channel_writev_full(QIOChannel *ioc,
int coroutine_mixed_fn qio_channel_readv_all_eof(QIOChannel *ioc,
const struct iovec *iov,
size_t niov,
+ int flags,
Error **errp)
{
- return qio_channel_readv_full_all_eof(ioc, iov, niov, NULL, NULL, errp);
+ return qio_channel_readv_full_all_eof(ioc, iov, niov, NULL, NULL, flags,
+ errp);
}
int coroutine_mixed_fn qio_channel_readv_all(QIOChannel *ioc,
@@ -130,6 +132,7 @@ int coroutine_mixed_fn qio_channel_readv_full_all_eof(QIOChannel *ioc,
const struct iovec *iov,
size_t niov,
int **fds, size_t *nfds,
+ int flags,
Error **errp)
{
int ret = -1;
@@ -155,7 +158,7 @@ int coroutine_mixed_fn qio_channel_readv_full_all_eof(QIOChannel *ioc,
while ((nlocal_iov > 0) || local_fds) {
ssize_t len;
len = qio_channel_readv_full(ioc, local_iov, nlocal_iov, local_fds,
- local_nfds, 0, errp);
+ local_nfds, flags, errp);
if (len == QIO_CHANNEL_ERR_BLOCK) {
if (qemu_in_coroutine()) {
qio_channel_yield(ioc, G_IO_IN);
@@ -222,7 +225,8 @@ int coroutine_mixed_fn qio_channel_readv_full_all(QIOChannel *ioc,
int **fds, size_t *nfds,
Error **errp)
{
- int ret = qio_channel_readv_full_all_eof(ioc, iov, niov, fds, nfds, errp);
+ int ret = qio_channel_readv_full_all_eof(ioc, iov, niov, fds, nfds, 0,
+ errp);
if (ret == 0) {
error_setg(errp, "Unexpected end-of-file before all data were read");
@@ -329,10 +333,11 @@ ssize_t qio_channel_write(QIOChannel *ioc,
int coroutine_mixed_fn qio_channel_read_all_eof(QIOChannel *ioc,
char *buf,
size_t buflen,
+ int flags,
Error **errp)
{
struct iovec iov = { .iov_base = buf, .iov_len = buflen };
- return qio_channel_readv_all_eof(ioc, &iov, 1, errp);
+ return qio_channel_readv_all_eof(ioc, &iov, 1, flags, errp);
}
@@ -1166,7 +1166,7 @@ static void *multifd_recv_thread(void *opaque)
}
ret = qio_channel_read_all_eof(p->c, (void *)p->packet,
- p->packet_len, &local_err);
+ p->packet_len, 0, &local_err);
if (!ret) {
/* EOF */
assert(!local_err);
@@ -237,7 +237,8 @@ static void coroutine_fn vh_co_entry(void *opaque)
* Only RAPL MSR in rapl-msr-index.h is allowed
*/
r = qio_channel_read_all_eof(QIO_CHANNEL(client->ioc),
- (char *) &request, sizeof(request), &local_err);
+ (char *) &request, sizeof(request), 0,
+ &local_err);
if (r <= 0) {
break;
}
@@ -190,7 +190,7 @@ vu_message_read(VuDev *vu_dev, int conn_fd, VhostUserMsg *vmsg)
.iov_len = vmsg->size,
};
if (vmsg->size) {
- rc = qio_channel_readv_all_eof(ioc, &iov_payload, 1, &local_err);
+ rc = qio_channel_readv_all_eof(ioc, &iov_payload, 1, 0, &local_err);
if (rc != 1) {
if (local_err) {
error_report_err(local_err);
We want to pass flags into qio_channel_tls_readv() but some functions along the way don't take a flags argument. Plumb the flags through. No functional change. Signed-off-by: Fabiano Rosas <farosas@suse.de> --- hw/remote/mpqemu-link.c | 2 +- include/io/channel.h | 6 ++++++ io/channel.c | 13 +++++++++---- migration/multifd.c | 2 +- tools/i386/qemu-vmsr-helper.c | 3 ++- util/vhost-user-server.c | 2 +- 6 files changed, 20 insertions(+), 8 deletions(-)