remote: Implement virStreamRecvHole

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
Michal Privoznik 2016-05-20 15:28:42 +02:00
parent 57760ec1e2
commit d6e5347ce3

View File

@ -5715,6 +5715,36 @@ remoteStreamSendHole(virStreamPtr st,
} }
static int
remoteStreamRecvHole(virStreamPtr st,
long long *length,
unsigned int flags)
{
struct private_data *priv = st->conn->privateData;
virNetClientStreamPtr privst = st->privateData;
int rv;
VIR_DEBUG("st=%p length=%p flags=%x",
st, length, flags);
virCheckFlags(0, -1);
if (virNetClientStreamRaiseError(privst))
return -1;
remoteDriverLock(priv);
priv->localUses++;
remoteDriverUnlock(priv);
rv = virNetClientStreamRecvHole(priv->client, privst, length);
remoteDriverLock(priv);
priv->localUses--;
remoteDriverUnlock(priv);
return rv;
}
struct remoteStreamCallbackData { struct remoteStreamCallbackData {
virStreamPtr st; virStreamPtr st;
virStreamEventCallback cb; virStreamEventCallback cb;
@ -5890,6 +5920,7 @@ static virStreamDriver remoteStreamDrv = {
.streamRecvFlags = remoteStreamRecvFlags, .streamRecvFlags = remoteStreamRecvFlags,
.streamSend = remoteStreamSend, .streamSend = remoteStreamSend,
.streamSendHole = remoteStreamSendHole, .streamSendHole = remoteStreamSendHole,
.streamRecvHole = remoteStreamRecvHole,
.streamFinish = remoteStreamFinish, .streamFinish = remoteStreamFinish,
.streamAbort = remoteStreamAbort, .streamAbort = remoteStreamAbort,
.streamEventAddCallback = remoteStreamEventAddCallback, .streamEventAddCallback = remoteStreamEventAddCallback,