This series extends the work introduced by commit aec21d3175 ("qapi: Add InetSocketAddress member keep-alive") [1]
First, it allows the use of the keep-alive flag for server-side sockets. Then it introduces a new keep-alive-idle-period setting, which changes the TCP_KEEPIDLE socket option on platforms that support it (this option is found in Linux, BSD, and Win32 documentations). By default, the value of keep-alive-idle-period is 0, which means no custom socket option value is set. This is useful, for example, for live migration. In case there is no traffic from the destination to the source machine during postcopy, the destination cannot detect a failed connection due to a lack of non-acknowledged packets and stays in the postcopy-active state until paused by the management of the QEMU instance. [1]: https://lore.kernel.org/all/20190725094937.32454-1-vsement...@virtuozzo.com/ --- V2: - moved socket options setting into a common function for both server and client sockets (suggested by Vladimir) Juraj Marcin (2): util/qemu-sockets: Add support for keep-alive flag to passive sockets utils/qemu-sockets: Introduce keep-alive-idle-period inet socket option io/dns-resolver.c | 6 ++++ meson.build | 2 ++ qapi/sockets.json | 9 +++-- util/qemu-sockets.c | 81 ++++++++++++++++++++++++++++++++------------- 4 files changed, 73 insertions(+), 25 deletions(-) -- 2.48.1