[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] net: stream: add a new option to automatically reconnect
|
From: |
Markus Armbruster |
|
Subject: |
Re: [PATCH] net: stream: add a new option to automatically reconnect |
|
Date: |
Thu, 10 Nov 2022 12:22:21 +0100 |
|
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) |
Laurent Vivier <lvivier@redhat.com> writes:
> 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>
> ---
[...]
> 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)
Double-checking: it attempts to reconnect *once*. Correct?
Are we sure multiples of seconds will be fine?
"For a client socket": what happens for a server socket?
> #
> # Only SocketAddress types 'unix', 'inet' and 'fd' are supported.
> #
> @@ -593,7 +596,8 @@
> { 'struct': 'NetdevStreamOptions',
> 'data': {
> 'addr': 'SocketAddress',
> - '*server': 'bool' } }
> + '*server': 'bool',
> + '*reconnect': 'uint32' } }
>
> ##
> # @NetdevDgramOptions:
[...]