On 1/3/23 15:28, Thomas Huth wrote:
On 03/01/2023 15.22, Laurent Vivier wrote:
In stream mode, if the server shuts down there is currently
no way to reconnect the client to a new server without removing
the NIC device and the netdev backend (or to reboot).
This patch introduces a reconnect option that specifies a delay
to try to reconnect with the same parameters.
Add a new test in qtest to test the reconnect option and the
connect/disconnect events.
Signed-off-by: Laurent Vivier <lviv...@redhat.com>
---
Based-on: <20230103110049.120340-1-lviv...@redhat.com>
v2:
- rebase
net/stream.c | 53 ++++++++++++++++++-
qapi/net.json | 6 ++-
qemu-options.hx | 6 +--
tests/qtest/netdev-socket.c | 100 ++++++++++++++++++++++++++++++++++++
4 files changed, 160 insertions(+), 5 deletions(-)
[...]
diff --git a/qapi/net.json b/qapi/net.json
index 522ac582edeb..5b72c936b3ac 100644
--- a/qapi/net.json
+++ b/qapi/net.json
@@ -585,6 +585,9 @@
# @addr: socket address to listen on (server=true)
# or connect to (server=false)
# @server: create server socket (default: false)
+# @reconnect: For a client socket, if a socket is disconnected,
+# then attempt a reconnect after the given number of seconds.
+# Setting this to zero disables this function. (default: 0)
I think this should get a "(since 8.0)" comment to make it clear when it has
been introduced?
Yes, you're right. It will be in the next patch version.
Thanks,
Laurent