mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-07-11 12:25:52 +00:00
Introduce VIR_NET_STREAM_HOLE message type
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>
This commit is contained in:
parent
7ddf7cbffd
commit
79d16419c4
@ -287,7 +287,8 @@ daemonStreamFilter(virNetServerClientPtr client ATTRIBUTE_UNUSED,
|
|||||||
|
|
||||||
virMutexLock(&stream->priv->lock);
|
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;
|
goto cleanup;
|
||||||
|
|
||||||
if (!virNetServerProgramMatches(stream->prog, msg))
|
if (!virNetServerProgramMatches(stream->prog, msg))
|
||||||
|
@ -1284,6 +1284,7 @@ virNetClientCallDispatch(virNetClientPtr client)
|
|||||||
return virNetClientCallDispatchMessage(client);
|
return virNetClientCallDispatchMessage(client);
|
||||||
|
|
||||||
case VIR_NET_STREAM: /* Stream protocol */
|
case VIR_NET_STREAM: /* Stream protocol */
|
||||||
|
case VIR_NET_STREAM_HOLE: /* Sparse stream protocol*/
|
||||||
return virNetClientCallDispatchStream(client);
|
return virNetClientCallDispatchStream(client);
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
@ -143,6 +143,14 @@ const VIR_NET_MESSAGE_NUM_FDS_MAX = 32;
|
|||||||
* * status == VIR_NET_ERROR
|
* * status == VIR_NET_ERROR
|
||||||
* remote_error Error information
|
* 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 {
|
enum virNetMessageType {
|
||||||
/* client -> server. args from a method call */
|
/* client -> server. args from a method call */
|
||||||
@ -156,7 +164,9 @@ enum virNetMessageType {
|
|||||||
/* client -> server. args from a method call, with passed FDs */
|
/* client -> server. args from a method call, with passed FDs */
|
||||||
VIR_NET_CALL_WITH_FDS = 4,
|
VIR_NET_CALL_WITH_FDS = 4,
|
||||||
/* server -> client. reply/error from a method call, with passed FDs */
|
/* 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 {
|
enum virNetMessageStatus {
|
||||||
|
@ -6,6 +6,7 @@ enum virNetMessageType {
|
|||||||
VIR_NET_STREAM = 3,
|
VIR_NET_STREAM = 3,
|
||||||
VIR_NET_CALL_WITH_FDS = 4,
|
VIR_NET_CALL_WITH_FDS = 4,
|
||||||
VIR_NET_REPLY_WITH_FDS = 5,
|
VIR_NET_REPLY_WITH_FDS = 5,
|
||||||
|
VIR_NET_STREAM_HOLE = 6,
|
||||||
};
|
};
|
||||||
enum virNetMessageStatus {
|
enum virNetMessageStatus {
|
||||||
VIR_NET_OK = 0,
|
VIR_NET_OK = 0,
|
||||||
|
Loading…
Reference in New Issue
Block a user