]> git.ipfire.org Git - thirdparty/qemu.git/commit
io/channel-socket: rework qio_channel_socket_copy_fds()
authorVladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
Tue, 16 Sep 2025 13:13:57 +0000 (16:13 +0300)
committerDaniel P. Berrangé <berrange@redhat.com>
Fri, 19 Sep 2025 11:46:07 +0000 (12:46 +0100)
commitd14c8cc69dcd64031019da857f93ee5f6d64bb75
tree6d5ca843c8715b93dcab0cd46028ba00c335c859
parent09759245cf762d2fed4259494ec31198ac1ec0f4
io/channel-socket: rework qio_channel_socket_copy_fds()

We want to switch from qemu_socket_set_block() to newer
qemu_set_blocking(), which provides return status of operation,
to handle errors.

Still, we want to keep qio_channel_socket_readv() interface clean,
as currently it allocate @fds only on success.

So, in case of error, we should close all incoming fds and keep
user's @fds untouched or zero.

Let's make separate functions qio_channel_handle_fds() and
qio_channel_cleanup_fds(), to achieve what we want.

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
include/io/channel.h
io/channel-socket.c