You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
qemu/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>
5 days ago
..
baum.c chardev/baum: Fix compiler warning for Windows builds 3 months ago
char-console.c qom: Have class_init() take a const data argument 7 months ago
char-fd.c chardev: qemu_chr_open_fd(): add errp 2 months ago
char-fe.c char: rename CharBackend->CharFrontend 3 weeks ago
char-file.c chardev: qemu_chr_open_fd(): add errp 2 months ago
char-hmp-cmds.c qapi: Move include/qapi/qmp/ to include/qobject/ 9 months ago
char-hub.c char: rename CharBackend->CharFrontend 3 weeks ago
char-io.c Revert "qemu-char: do not operate on sources from finalize callbacks" 1 year ago
char-mux.c char: rename CharBackend->CharFrontend 3 weeks ago
char-null.c qom: Have class_init() take a const data argument 7 months ago
char-parallel.c qom: Have class_init() take a const data argument 7 months ago
char-pipe.c chardev: qemu_chr_open_fd(): add errp 2 months ago
char-pty.c chardev: close an fd on failure path 2 months ago
char-ringbuf.c qom: Have class_init() take a const data argument 7 months ago
char-serial.c chardev: close an fd on failure path 2 months ago
char-socket.c qio: Provide accessor around QIONetListener->sioc 5 days ago
char-stdio.c chardev: qemu_chr_open_fd(): add errp 2 months ago
char-udp.c qom: Have class_init() take a const data argument 7 months ago
char-win-stdio.c qom: Have class_init() take a const data argument 7 months ago
char-win.c qom: Have class_init() take a const data argument 7 months ago
char.c trivial patches for 2025-10-29 3 weeks ago
chardev-internal.h char: rename CharBackend->CharFrontend 3 weeks ago
meson.build chardev/char-hub: implement backend chardev aggregator 10 months ago
msmouse.c qom: Have class_init() take a const data argument 7 months ago
spice.c qom: Have class_init() take a const data argument 7 months ago
testdev.c qom: Have class_init() take a const data argument 7 months ago
trace-events chardev: add tracing of socket error conditions 1 year ago
trace.h trace: switch position of headers to what Meson requires 5 years ago
wctablet.c qom: Have class_init() take a const data argument 7 months ago