[libvirt] [PATCH] util, remote: Fixing the sending of stream when length is defined.
Peter Krempa
pkrempa at redhat.com
Mon Mar 5 08:53:37 UTC 2018
On Sun, Mar 04, 2018 at 16:24:21 -0300, Julio Faracco wrote:
> When a length of a file is defined, the responsible thread to send
> stream is finishing inappropriately. It is happening because there is
> wrong conditional which compares an offset with the length and because
> of that the code throws ENOSPC error.
>
> To test it:
> virsh# vol-upload ... --length N
>
> Signed-off-by: Julio Faracco <jcfaracco at gmail.com>
> ---
> src/remote/remote_daemon_stream.c | 24 ++++++++++++------------
> src/util/virfdstream.c | 5 +----
> 2 files changed, 13 insertions(+), 16 deletions(-)
>
> diff --git a/src/remote/remote_daemon_stream.c b/src/remote/remote_daemon_stream.c
> index 4dd3af9e0..998e82a83 100644
> --- a/src/remote/remote_daemon_stream.c
> +++ b/src/remote/remote_daemon_stream.c
> @@ -549,21 +549,21 @@ daemonStreamHandleWriteData(virNetServerClientPtr client,
> } else if (ret == -2) {
> /* Blocking, so indicate we have more todo later */
> return 1;
> - } else {
> - virNetMessageError rerr;
> + } else if (ret) {
> + virNetMessageError rerr;
>
> - memset(&rerr, 0, sizeof(rerr));
> + memset(&rerr, 0, sizeof(rerr));
>
> - VIR_INFO("Stream send failed");
> - stream->closed = true;
> - virStreamEventRemoveCallback(stream->st);
> - virStreamAbort(stream->st);
> + VIR_INFO("Stream send failed");
> + stream->closed = true;
> + virStreamEventRemoveCallback(stream->st);
> + virStreamAbort(stream->st);
It does not seem to be necessary to change indentation because of your
change here.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20180305/d21cc84b/attachment-0001.sig>
More information about the libvir-list
mailing list