qemu-cr16/io
Eric Blake 36769aeedf qio: Minor optimization when callback function is unchanged
In qemu-nbd and other NBD server setups where parallel clients are
supported, it is common that the caller will re-register the same
callback function as long as it has not reached its limit on
simultaneous clients.  In that case, there is no need to tear down and
reinstall GSource watches in the GMainContext.

In practice, all existing callers currently pass NULL for notify, and
no caller ever changes context across calls (for async uses, either
the caller consistently uses qio_net_listener_set_client_func_full
with the same context, or the caller consistently uses only
qio_net_listener_set_client_func which always uses the global
context); but the time spent checking these two fields in addition to
the more important func and data is still less than the savings of not
churning through extra GSource manipulations when the result will be
unchanged.

Signed-off-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Message-ID: <20251113011625.878876-21-eblake@redhat.com>
2025-11-13 09:51:51 -06:00
..
channel-buffer.c qom: Have class_init() take a const data argument 2025-04-25 17:00:41 +02:00
channel-command.c treewide: use qemu_set_blocking instead of g_unix_set_fd_nonblocking 2025-09-19 12:46:07 +01:00
channel-file.c treewide: use qemu_set_blocking instead of g_unix_set_fd_nonblocking 2025-09-19 12:46:07 +01:00
channel-null.c qom: Have class_init() take a const data argument 2025-04-25 17:00:41 +02:00
channel-socket.c io: flush zerocopy socket error queue on sendmsg failure due to ENOBUF 2025-11-03 10:45:28 +00:00
channel-tls.c io/channel: Have read/write functions take void * buffer argument 2025-11-03 10:05:40 +00:00
channel-util.c io: follow coroutine AioContext in qio_channel_yield() 2023-09-07 20:32:11 -05:00
channel-watch.c error: Kill @error_warn 2025-10-01 08:33:24 +02:00
channel-websock.c io: fix use after free in websocket handshake code 2025-10-24 13:04:31 +01:00
channel.c mem + migration pull for 10.2 2025-11-04 16:19:35 +01:00
dns-resolver.c io: Fix partial struct copy in qio_dns_resolver_lookup_sync_inet() 2025-05-22 11:24:41 +01:00
meson.build Revert "meson: Propagate gnutls dependency" 2024-07-03 18:41:26 +02:00
net-listener.c qio: Minor optimization when callback function is unchanged 2025-11-13 09:51:51 -06:00
task.c io: Fix Lesser GPL version number 2020-10-29 09:57:37 +00:00
trace-events qio: Remember context of qio_net_listener_set_client_func_full 2025-11-13 08:29:46 -06:00
trace.h trace: switch position of headers to what Meson requires 2020-08-21 06:18:24 -04:00