[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [libvirt] [PATCH v2 29/38] remote: Implement virStreamHoleSize




On 04/20/2017 06:01 AM, Michal Privoznik wrote:
> Signed-off-by: Michal Privoznik <mprivozn redhat com>
> ---
>  src/remote/remote_driver.c | 24 ++++++++++++++++++++++++
>  1 file changed, 24 insertions(+)
> 

Code seems reasonable - would be affected by API name changes and a
@flags argument.

John
> diff --git a/src/remote/remote_driver.c b/src/remote/remote_driver.c
> index 0512f14..376e9ba 100644
> --- a/src/remote/remote_driver.c
> +++ b/src/remote/remote_driver.c
> @@ -5712,6 +5712,29 @@ remoteStreamSkip(virStreamPtr st,
>  }
>  
>  
> +static int
> +remoteStreamHoleSize(virStreamPtr st,
> +                     unsigned long long *length)
> +{
> +    VIR_DEBUG("st=%p length=%p", st, length);
> +    struct private_data *priv = st->conn->privateData;
> +    virNetClientStreamPtr privst = st->privateData;
> +    int rv;
> +
> +    if (virNetClientStreamRaiseError(privst))
> +        return -1;
> +
> +    remoteDriverLock(priv);
> +    priv->localUses++;
> +    remoteDriverUnlock(priv);
> +
> +    rv = virNetClientStreamHoleSize(priv->client, privst, length);
> +
> +    remoteDriverLock(priv);
> +    priv->localUses--;
> +    remoteDriverUnlock(priv);
> +    return rv;
> +}
>  struct remoteStreamCallbackData {
>      virStreamPtr st;
>      virStreamEventCallback cb;
> @@ -5887,6 +5910,7 @@ static virStreamDriver remoteStreamDrv = {
>      .streamRecvFlags = remoteStreamRecvFlags,
>      .streamSend = remoteStreamSend,
>      .streamSkip = remoteStreamSkip,
> +    .streamHoleSize = remoteStreamHoleSize,
>      .streamFinish = remoteStreamFinish,
>      .streamAbort = remoteStreamAbort,
>      .streamEventAddCallback = remoteStreamEventAddCallback,
> 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]