diff options
author | Laurent Vivier <lvivier@redhat.com> | 2023-01-19 11:16:45 +0100 |
---|---|---|
committer | Jason Wang <jasowang@redhat.com> | 2023-02-17 13:31:33 +0800 |
commit | 148fbf0d58a6fa9c6881db28fced8c071c3be100 (patch) | |
tree | 3767acc46b7c180c1685ca77b7073dfe899f9168 /qapi | |
parent | 993f71ee3360450c2758964adbdfb13f4d460162 (diff) |
net: stream: add a new option to automatically reconnect
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 <lvivier@redhat.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
Diffstat (limited to 'qapi')
-rw-r--r-- | qapi/net.json | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/qapi/net.json b/qapi/net.json index 522ac582ed..d6eb30008b 100644 --- a/qapi/net.json +++ b/qapi/net.json @@ -585,6 +585,10 @@ # @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) +# (since 8.0) # # Only SocketAddress types 'unix', 'inet' and 'fd' are supported. # @@ -593,7 +597,8 @@ { 'struct': 'NetdevStreamOptions', 'data': { 'addr': 'SocketAddress', - '*server': 'bool' } } + '*server': 'bool', + '*reconnect': 'uint32' } } ## # @NetdevDgramOptions: |