[libvirt] [PATCH v3 22/31] Introduce virNetClientStreamRecvHole

John Ferlan jferlan at redhat.com
Wed May 17 12:52:09 UTC 2017



On 05/16/2017 10:04 AM, Michal Privoznik wrote:
> This function will fetch previously processed stream holes and
> return their sum.
> 
> Signed-off-by: Michal Privoznik <mprivozn at redhat.com>
> ---
>  src/libvirt_remote.syms      |  1 +
>  src/rpc/virnetclientstream.c | 16 ++++++++++++++++
>  src/rpc/virnetclientstream.h |  4 ++++
>  3 files changed, 21 insertions(+)
> 
> diff --git a/src/libvirt_remote.syms b/src/libvirt_remote.syms
> index 186d2c622..61c20d530 100644
> --- a/src/libvirt_remote.syms
> +++ b/src/libvirt_remote.syms
> @@ -52,6 +52,7 @@ virNetClientStreamMatches;
>  virNetClientStreamNew;
>  virNetClientStreamQueuePacket;
>  virNetClientStreamRaiseError;
> +virNetClientStreamRecvHole;
>  virNetClientStreamRecvPacket;
>  virNetClientStreamSendHole;
>  virNetClientStreamSendPacket;
> diff --git a/src/rpc/virnetclientstream.c b/src/rpc/virnetclientstream.c
> index 4a3d843b1..bf3922cb5 100644
> --- a/src/rpc/virnetclientstream.c
> +++ b/src/rpc/virnetclientstream.c
> @@ -583,6 +583,22 @@ virNetClientStreamSendHole(virNetClientStreamPtr st,
>  }
>  
>  
> +int virNetClientStreamRecvHole(virNetClientPtr client ATTRIBUTE_UNUSED,
> +                               virNetClientStreamPtr st,
> +                               long long *length)

This should be

int
virNetClient...

Although, yes, different than other functions here.


Reviewed-by: John Ferlan <jferlan at redhat.com>

John

> +{
> +    if (!st->allowSkip) {
> +        virReportError(VIR_ERR_OPERATION_INVALID, "%s",
> +                       _("Holes are not supported with this stream"));
> +        return -1;
> +    }
> +
> +    *length = st->holeLength;
> +    st->holeLength = 0;
> +    return 0;
> +}
> +
> +

[...]




More information about the libvir-list mailing list