[PATCH v2 28/38] Introduce virNetClientStreamHoleSize

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

 



This function will fetch previously processed stream holes and
return their sum.

Signed-off-by: Michal Privoznik <mprivozn@xxxxxxxxxx>
---
 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 6093613..f546647 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 f687bfa..c773524 100644
--- a/src/rpc/virnetclientstream.c
+++ b/src/rpc/virnetclientstream.c
@@ -548,6 +548,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.10.2

--
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