This function will fetch previously processed stream holes and
return their sum.
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
src/libvirt_remote.syms | 1 +
src/rpc/virnetclientstream.c | 15 +++++++++++++++
src/rpc/virnetclientstream.h | 4 ++++
3 files changed, 20 insertions(+)
diff --git a/src/libvirt_remote.syms b/src/libvirt_remote.syms
index 16fde79..d843fc6 100644
--- a/src/libvirt_remote.syms
+++ b/src/libvirt_remote.syms
@@ -48,6 +48,7 @@ virNetClientStreamEOF;
virNetClientStreamEventAddCallback;
virNetClientStreamEventRemoveCallback;
virNetClientStreamEventUpdateCallback;
+virNetClientStreamHoleSize;
virNetClientStreamMatches;
virNetClientStreamNew;
virNetClientStreamQueuePacket;
diff --git a/src/rpc/virnetclientstream.c b/src/rpc/virnetclientstream.c
index c8c89ec..37ce257 100644
--- a/src/rpc/virnetclientstream.c
+++ b/src/rpc/virnetclientstream.c
@@ -550,6 +550,21 @@ virNetClientStreamSendSkip(virNetClientStreamPtr st,
}
+int virNetClientStreamHoleSize(virNetClientPtr client ATTRIBUTE_UNUSED,
+ virNetClientStreamPtr st,
+ unsigned long long *length)
+{
+ int ret = st->skipLength;
+
+ if (length) {
+ *length = st->skipLength;
+ st->skipLength = 0;
+ }
+
+ return ret;
+}
+
+
int virNetClientStreamEventAddCallback(virNetClientStreamPtr st,
int events,
virNetClientStreamEventCallback cb,
diff --git a/src/rpc/virnetclientstream.h b/src/rpc/virnetclientstream.h
index 2835066..9caa091 100644
--- a/src/rpc/virnetclientstream.h
+++ b/src/rpc/virnetclientstream.h
@@ -66,6 +66,10 @@ int virNetClientStreamSendSkip(virNetClientStreamPtr st,
virNetClientPtr client,
unsigned long long length);
+int virNetClientStreamHoleSize(virNetClientPtr client,
+ virNetClientStreamPtr st,
+ unsigned long long *length);
+
int virNetClientStreamEventAddCallback(virNetClientStreamPtr st,
int events,
virNetClientStreamEventCallback cb,
--
2.8.4