On 7/25/19 5:48 AM, Daniel P. Berrangé wrote:
On Fri, Jul 12, 2019 at 12:23:48PM -0400, Stefan Berger wrote:
> Extend virCommandProcessIO to include the send buffers in the poll
> loop.
>
> Signed-off-by: Stefan Berger <stefanb(a)linux.ibm.com>
> ---
> src/util/vircommand.c | 62 ++++++++++++++++++++++++++++++++++++++++++-
> 1 file changed, 61 insertions(+), 1 deletion(-)
>
> diff --git a/src/util/vircommand.c b/src/util/vircommand.c
> index bb9ecdf348..976231444e 100644
> --- a/src/util/vircommand.c
> +++ b/src/util/vircommand.c
> @@ -1815,6 +1815,61 @@ virCommandSetSendBuffer(virCommandPtr cmd,
> }
>
>
> +static int
> +virCommandSendBuffersFillPollfd(virCommandPtr cmd,
> + struct pollfd *fds,
> + int startidx)
> +{
> + size_t i, j;
> +
> + for (i = 0, j = 0; i < virCommandGetNumSendBuffers(cmd); i++) {
> + if (cmd->sendBuffers[i].fd >= 0) {
> + fds[startidx + j].fd = cmd->sendBuffers[i].fd;
> + fds[startidx + j].events = POLLOUT;
> + fds[startidx + j].revents = 0;
> + j++;
> + }
> + }
> +
> + return j;
> +}
> +
> +
> +static int
> +virCommandSendBuffersHandlePoll(virCommandPtr cmd,
> + struct pollfd *fds)
> +{
> + size_t i;
> + int done;
ssize_t is the return type for write()
Fixed.
Regards,
Stefan