aboutsummaryrefslogtreecommitdiff
path: root/samples
diff options
context:
space:
mode:
authorMattias Nissler <122288598+mnissler-rivos@users.noreply.github.com>2023-09-15 12:33:37 +0200
committerGitHub <noreply@github.com>2023-09-15 11:33:37 +0100
commit1569a37a54ecb63bd4008708c76339ccf7d06115 (patch)
tree249f6e0bd2dd5b8620bc55637e60c8834d5cf630 /samples
parent478ddb5f87ea257c8682c5288761606d5fa216ad (diff)
downloadlibvfio-user-1569a37a54ecb63bd4008708c76339ccf7d06115.zip
libvfio-user-1569a37a54ecb63bd4008708c76339ccf7d06115.tar.gz
libvfio-user-1569a37a54ecb63bd4008708c76339ccf7d06115.tar.bz2
Pass server->client command over a separate socket pair (#762)
Use separate socket for server->client commands This change adds support for a separate socket to carry commands in the server-to-client direction. It has proven problematic to send commands in both directions over a single socket, since matching replies to commands can become non-trivial when both sides send commands at the same time and adds significant complexity. See issue #279 for details. To set up the reverse communication channel, the client indicates support for it via a new capability flag in the version message. The server will then create a fresh pair of sockets and pass one end to the client in its version reply. When the server wishes to send commands to the client at a later point, it now uses its end of the new socket pair rather than the main socket. Corresponding replies are also passed back over the new socket pair. Signed-off-by: Mattias Nissler <mnissler@rivosinc.com>
Diffstat (limited to 'samples')
-rw-r--r--samples/client.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/samples/client.c b/samples/client.c
index 0086fd6..ed66a30 100644
--- a/samples/client.c
+++ b/samples/client.c
@@ -197,7 +197,7 @@ recv_version(int sock, int *server_max_fds, size_t *server_max_data_xfer_size,
}
ret = tran_parse_version_json(json_str, server_max_fds,
- server_max_data_xfer_size, pgsize);
+ server_max_data_xfer_size, pgsize, NULL);
if (ret < 0) {
err(EXIT_FAILURE, "failed to parse server JSON \"%s\"", json_str);