This is a special type of stream packet, that is bidirectional
and will contain information on how much bytes are both sides
skipping in the stream.
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
daemon/stream.c | 3 ++-
src/rpc/virnetclient.c | 1 +
src/rpc/virnetprotocol.x | 12 +++++++++++-
src/virnetprotocol-structs | 1 +
4 files changed, 15 insertions(+), 2 deletions(-)
diff --git a/daemon/stream.c b/daemon/stream.c
index 02729e4..b7ccc85 100644
--- a/daemon/stream.c
+++ b/daemon/stream.c
@@ -285,7 +285,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_SKIP)
goto cleanup;
if (!virNetServerProgramMatches(stream->prog, msg))
diff --git a/src/rpc/virnetclient.c b/src/rpc/virnetclient.c
index 781e74c..cb87b81 100644
--- a/src/rpc/virnetclient.c
+++ b/src/rpc/virnetclient.c
@@ -1147,6 +1147,7 @@ virNetClientCallDispatch(virNetClientPtr client)
return virNetClientCallDispatchMessage(client);
case VIR_NET_STREAM: /* Stream protocol */
+ case VIR_NET_STREAM_SKIP: /* Stream seek protocol */
return virNetClientCallDispatchStream(client);
default:
diff --git a/src/rpc/virnetprotocol.x b/src/rpc/virnetprotocol.x
index f73e1aa..b4b3f17 100644
--- a/src/rpc/virnetprotocol.x
+++ b/src/rpc/virnetprotocol.x
@@ -140,6 +140,14 @@ const VIR_NET_MESSAGE_NUM_FDS_MAX = 32;
* * status == VIR_NET_ERROR
* remote_error Error information
*
+ * - type == VIR_NET_STREAM_SKIP
+ * * status == VIR_NET_CONTINUE
+ * byte[] skip data
+ * * status == VIR_NET_ERROR
+ * remote_error error information
+ * * status == VIR_NET_OK
+ * <empty>
+ *
*/
enum virNetMessageType {
/* client -> server. args from a method call */
@@ -153,7 +161,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 skip data packet */
+ VIR_NET_STREAM_SKIP = 6
};
enum virNetMessageStatus {
diff --git a/src/virnetprotocol-structs b/src/virnetprotocol-structs
index 96b984e..3758a65 100644
--- a/src/virnetprotocol-structs
+++ b/src/virnetprotocol-structs
@@ -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_SKIP = 6,
};
enum virNetMessageStatus {
VIR_NET_OK = 0,
--
2.8.1