From: Marc-André Lureau<address@hidden>
Learn to give a socket to the slave to let him make requests to the
master.
Signed-off-by: Marc-André Lureau<address@hidden>
Signed-off-by: Maxime Coquelin<address@hidden>
---
docs/specs/vhost-user.txt | 32 +++++++++++-
hw/virtio/vhost-user.c | 127 ++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 157 insertions(+), 2 deletions(-)
diff --git a/docs/specs/vhost-user.txt b/docs/specs/vhost-user.txt
index 036890f..5fa7016 100644
--- a/docs/specs/vhost-user.txt
+++ b/docs/specs/vhost-user.txt
@@ -139,6 +139,7 @@ in the ancillary data:
* VHOST_USER_SET_VRING_KICK
* VHOST_USER_SET_VRING_CALL
* VHOST_USER_SET_VRING_ERR
+ * VHOST_USER_SET_SLAVE_REQ_FD
If Master is unable to send the full message or receives a wrong reply it will
close the connection. An optional reconnection mechanism can be implemented.
@@ -252,6 +253,18 @@ Once the source has finished migration, rings will be
stopped by
the source. No further update must be done before rings are
restarted.
+Slave communication
+-------------------
+
+An optional communication channel is provided if the slave declares
+VHOST_USER_PROTOCOL_F_SLAVE_REQ protocol feature, to allow the slave to make
+requests to the master.
+
+The fd is provided via VHOST_USER_SET_SLAVE_REQ_FD ancillary data.
+
+A slave may then send VHOST_USER_SLAVE_* messages to the master
+using this fd communication channel.
+
Protocol features
-----------------
@@ -260,9 +273,10 @@ Protocol features
#define VHOST_USER_PROTOCOL_F_RARP 2
#define VHOST_USER_PROTOCOL_F_REPLY_ACK 3
#define VHOST_USER_PROTOCOL_F_MTU 4
+#define VHOST_USER_PROTOCOL_F_SLAVE_REQ 5
-Message types
--------------
+Master message types
+--------------------
* VHOST_USER_GET_FEATURES