mirror of
https://github.com/mii443/qemu.git
synced 2025-12-03 11:08:25 +00:00
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>
This commit is contained in:
committed by
Jason Wang
parent
993f71ee33
commit
148fbf0d58
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user