[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 02/12] chardev: forbid 'reconnect' option with s
From: |
Thomas Huth |
Subject: |
Re: [Qemu-devel] [PATCH 02/12] chardev: forbid 'reconnect' option with server sockets |
Date: |
Wed, 16 Jan 2019 06:11:41 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 |
On 2019-01-15 15:52, Daniel P. Berrangé wrote:
> The 'reconnect' option is used to give the sleep time, in seconds,
> before a client socket attempts to re-establish a connection to the
> server. It does not make sense to set this for server sockets, as they
> will always accept a new client connection immediately after the
> previous one went away.
>
> Signed-off-by: Daniel P. Berrangé <address@hidden>
> ---
> chardev/char-socket.c | 9 ++++++++-
> 1 file changed, 8 insertions(+), 1 deletion(-)
>
> diff --git a/chardev/char-socket.c b/chardev/char-socket.c
> index 6669acb35f..4570755adf 100644
> --- a/chardev/char-socket.c
> +++ b/chardev/char-socket.c
> @@ -1035,7 +1035,14 @@ static bool qmp_chardev_validate_socket(ChardevSocket
> *sock,
> }
>
> /* Validate any options which have a dependancy on client vs server */
> - if (!(sock->has_server && sock->server)) {
> + if (!sock->has_server || sock->server) {
> + if (sock->has_reconnect) {
> + error_setg(errp,
> + "'reconnect' option is incompatible with "
> + "socket in server listen mode");
> + return false;
> + }
> + } else {
> if (sock->has_websocket && sock->websocket) {
> error_setg(errp, "%s", "Websocket client is not implemented");
> return false;
>
Reviewed-by: Thomas Huth <address@hidden>
- [Qemu-devel] [PATCH 09/12] chardev: use a state machine for socket connection state, (continued)
- [Qemu-devel] [PATCH 09/12] chardev: use a state machine for socket connection state, Daniel P . Berrangé, 2019/01/15
- [Qemu-devel] [PATCH 10/12] chardev: honour the reconnect setting in tcp_chr_wait_connected, Daniel P . Berrangé, 2019/01/15
- [Qemu-devel] [PATCH 11/12] chardev: disallow TLS/telnet/websocket with tcp_chr_wait_connected, Daniel P . Berrangé, 2019/01/15
- [Qemu-devel] [PATCH 12/12] chardev: fix race with client connections in tcp_chr_wait_connected, Daniel P . Berrangé, 2019/01/15
- [Qemu-devel] [PATCH 02/12] chardev: forbid 'reconnect' option with server sockets, Daniel P . Berrangé, 2019/01/15
- [Qemu-devel] [PATCH 05/12] chardev: ensure qemu_chr_parse_compat reports missing driver error, Daniel P . Berrangé, 2019/01/15
- [Qemu-devel] [PATCH 01/12] chardev: fix validation of options for QMP created chardevs, Daniel P . Berrangé, 2019/01/15
Re: [Qemu-devel] [PATCH 00/12] chardev: refactoring & many bugfixes related tcp_chr_wait_connected, no-reply, 2019/01/21