qemu-cr16/chardev
Eric Blake ec59a65a4d qio: Provide accessor around QIONetListener->sioc
An upcoming patch needs to pass more than just sioc as the opaque
pointer to an AioContext; but since our AioContext code in general
(and its QIO Channel wrapper code) lacks a notify callback present
with GSource, we do not have the trivial option of just g_malloc'ing a
small struct to hold all that data coupled with a notify of g_free.
Instead, the data pointer must outlive the registered handler; in
fact, having the data pointer have the same lifetime as QIONetListener
is adequate.

But the cleanest way to stick such a helper struct in QIONetListener
will be to rearrange internal struct members.  And that in turn means
that all existing code that currently directly accesses
listener->nsioc and listener->sioc[] should instead go through
accessor functions, to be immune to the upcoming struct layout
changes.  So this patch adds accessor methods qio_net_listener_nsioc()
and qio_net_listener_sioc(), and puts them to use.

While at it, notice that the pattern of grabbing an sioc from the
listener only to turn around can call
qio_channel_socket_get_local_address is common enough to also warrant
the helper of qio_net_listener_get_local_address, and fix a copy-paste
error in the corresponding documentation.

Signed-off-by: Eric Blake <eblake@redhat.com>
Message-ID: <20251113011625.878876-24-eblake@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2025-11-13 10:54:44 -06:00
..
baum.c chardev/baum: Fix compiler warning for Windows builds 2025-09-03 10:56:11 +03:00
char-console.c qom: Have class_init() take a const data argument 2025-04-25 17:00:41 +02:00
char-fd.c chardev: qemu_chr_open_fd(): add errp 2025-09-19 12:46:07 +01:00
char-fe.c char: rename CharBackend->CharFrontend 2025-10-28 14:49:52 +01:00
char-file.c chardev: qemu_chr_open_fd(): add errp 2025-09-19 12:46:07 +01:00
char-hmp-cmds.c qapi: Move include/qapi/qmp/ to include/qobject/ 2025-02-10 15:33:16 +01:00
char-hub.c char: rename CharBackend->CharFrontend 2025-10-28 14:49:52 +01:00
char-io.c Revert "qemu-char: do not operate on sources from finalize callbacks" 2024-07-16 10:45:06 +02:00
char-mux.c char: rename CharBackend->CharFrontend 2025-10-28 14:49:52 +01:00
char-null.c qom: Have class_init() take a const data argument 2025-04-25 17:00:41 +02:00
char-parallel.c qom: Have class_init() take a const data argument 2025-04-25 17:00:41 +02:00
char-pipe.c chardev: qemu_chr_open_fd(): add errp 2025-09-19 12:46:07 +01:00
char-pty.c chardev: close an fd on failure path 2025-09-19 12:46:07 +01:00
char-ringbuf.c qom: Have class_init() take a const data argument 2025-04-25 17:00:41 +02:00
char-serial.c chardev: close an fd on failure path 2025-09-19 12:46:07 +01:00
char-socket.c qio: Provide accessor around QIONetListener->sioc 2025-11-13 10:54:44 -06:00
char-stdio.c chardev: qemu_chr_open_fd(): add errp 2025-09-19 12:46:07 +01:00
char-udp.c qom: Have class_init() take a const data argument 2025-04-25 17:00:41 +02:00
char-win-stdio.c qom: Have class_init() take a const data argument 2025-04-25 17:00:41 +02:00
char-win.c qom: Have class_init() take a const data argument 2025-04-25 17:00:41 +02:00
char.c trivial patches for 2025-10-29 2025-10-29 10:44:15 +01:00
chardev-internal.h char: rename CharBackend->CharFrontend 2025-10-28 14:49:52 +01:00
meson.build chardev/char-hub: implement backend chardev aggregator 2025-02-03 13:57:08 +04:00
msmouse.c qom: Have class_init() take a const data argument 2025-04-25 17:00:41 +02:00
spice.c qom: Have class_init() take a const data argument 2025-04-25 17:00:41 +02:00
testdev.c qom: Have class_init() take a const data argument 2025-04-25 17:00:41 +02:00
trace-events chardev: add tracing of socket error conditions 2024-07-24 10:39:10 +01:00
trace.h trace: switch position of headers to what Meson requires 2020-08-21 06:18:24 -04:00
wctablet.c qom: Have class_init() take a const data argument 2025-04-25 17:00:41 +02:00