]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
Introduce VIR_NET_STREAM_HOLE message type
authorMichal Privoznik <mprivozn@redhat.com>
Mon, 4 Apr 2016 12:54:46 +0000 (14:54 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Thu, 18 May 2017 05:42:13 +0000 (07:42 +0200)
This is a special type of stream packet, that is bidirectional
and contains information regarding how many bytes each side will
be skipping in the stream.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
daemon/stream.c
src/rpc/virnetclient.c
src/rpc/virnetprotocol.x
src/virnetprotocol-structs

index 6465463ff9eb7025877f65b55e178021c31c22fb..f44c21278a17e839c6f78ac64a3d27650e393c73 100644 (file)
@@ -287,7 +287,8 @@ daemonStreamFilter(virNetServerClientPtr client ATTRIBUTE_UNUSED,
 
     virMutexLock(&stream->priv->lock);
 
-    if (msg->header.type != VIR_NET_STREAM)
+    if (msg->header.type != VIR_NET_STREAM &&
+        msg->header.type != VIR_NET_STREAM_HOLE)
         goto cleanup;
 
     if (!virNetServerProgramMatches(stream->prog, msg))
index 837a8a70748b87ad3b32ffbf8b81be2a2b4bcc8a..95cd9a6c7e6f2e37949183f3e25f8b0da0d57f80 100644 (file)
@@ -1284,6 +1284,7 @@ virNetClientCallDispatch(virNetClientPtr client)
         return virNetClientCallDispatchMessage(client);
 
     case VIR_NET_STREAM: /* Stream protocol */
+    case VIR_NET_STREAM_HOLE: /* Sparse stream protocol*/
         return virNetClientCallDispatchStream(client);
 
     default:
index cab047cb01b8a7dda6e6dc53558a796259c8ba06..ee98990590929d3185d044685c6c89833858c894 100644 (file)
@@ -143,6 +143,14 @@ const VIR_NET_MESSAGE_NUM_FDS_MAX = 32;
  *     * status == VIR_NET_ERROR
  *          remote_error    Error information
  *
+ *  - type == VIR_NET_STREAM_HOLE
+ *     * status == VIR_NET_CONTINUE
+ *          byte[]  hole data
+ *     * status == VIR_NET_ERROR
+ *          remote_error error information
+ *     * status == VIR_NET_OK
+ *          <empty>
+ *
  */
 enum virNetMessageType {
     /* client -> server. args from a method call */
@@ -156,7 +164,9 @@ enum virNetMessageType {
     /* client -> server. args from a method call, with passed FDs */
     VIR_NET_CALL_WITH_FDS = 4,
     /* server -> client. reply/error from a method call, with passed FDs */
-    VIR_NET_REPLY_WITH_FDS = 5
+    VIR_NET_REPLY_WITH_FDS = 5,
+    /* either direction, stream hole data packet */
+    VIR_NET_STREAM_HOLE = 6
 };
 
 enum virNetMessageStatus {
index aa6e0602a765b96ae96e109bc19bdd39cda34db6..b36581f86fcc8b46c3841f0596fdd374b7a50bd2 100644 (file)
@@ -6,6 +6,7 @@ enum virNetMessageType {
         VIR_NET_STREAM = 3,
         VIR_NET_CALL_WITH_FDS = 4,
         VIR_NET_REPLY_WITH_FDS = 5,
+        VIR_NET_STREAM_HOLE = 6,
 };
 enum virNetMessageStatus {
         VIR_NET_OK = 0,