]> git.ipfire.org Git - thirdparty/qemu.git/commit
util/qemu-sockets: Add support for keep-alive flag to passive sockets
authorJuraj Marcin <jmarcin@redhat.com>
Wed, 21 May 2025 13:52:33 +0000 (15:52 +0200)
committerDaniel P. Berrangé <berrange@redhat.com>
Thu, 22 May 2025 10:24:41 +0000 (11:24 +0100)
commit00064705ed1f3943d3634be25da434466c87e7d5
tree81884f65ce3452961df543af853960337d0532b9
parent911e0f2c6e2d00c985affa75ec188c8edcf480f2
util/qemu-sockets: Add support for keep-alive flag to passive sockets

Commit aec21d3175 (qapi: Add InetSocketAddress member keep-alive)
introduces the keep-alive flag, which enables the SO_KEEPALIVE socket
option, but only on client-side sockets. However, this option is also
useful for server-side sockets, so they can check if a client is still
reachable or drop the connection otherwise.

This patch enables the SO_KEEPALIVE socket option on passive server-side
sockets if the keep-alive flag is enabled. This socket option is then
inherited by active server-side sockets communicating with connected
clients.

Signed-off-by: Juraj Marcin <jmarcin@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
qapi/sockets.json
util/qemu-sockets.c