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

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

 




On 04/20/2017 06:01 AM, Michal Privoznik wrote:
> Signed-off-by: Michal Privoznik <mprivozn@xxxxxxxxxx>
> ---
>  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,
> 

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]
  Powered by Linux