Am 03.11.2025 um 21:10 hat Eric Blake geschrieben:
> Upcoming patches will adjust how net_listener watches for new client
> connections; adding trace points now makes it easier to debug that the
> changes work as intended. For example, adding
> --trace='qio_net_listener*' to the qemu-storage-daemon command line
> before --nbd-server will track when the server first starts listening
> for clients.
>
> Signed-off-by: Eric Blake <[email protected]>
> ---
> io/net-listener.c | 17 +++++++++++++++++
> io/trace-events | 5 +++++
> 2 files changed, 22 insertions(+)
>
> diff --git a/io/net-listener.c b/io/net-listener.c
> index 47405965a66..0adbc409cf2 100644
> --- a/io/net-listener.c
> +++ b/io/net-listener.c
> @@ -23,6 +23,7 @@
> #include "io/dns-resolver.h"
> #include "qapi/error.h"
> #include "qemu/module.h"
> +#include "trace.h"
>
> QIONetListener *qio_net_listener_new(void)
> {
> @@ -50,6 +51,7 @@ static gboolean qio_net_listener_channel_func(QIOChannel
> *ioc,
> return TRUE;
> }
>
> + trace_qio_net_listener_callback(listener, listener->io_func);
> if (listener->io_func) {
> listener->io_func(listener, sioc, listener->io_data);
> }
Not necessarily a problem, but I wonder why you decided to have the
trace point unconditional here...
> @@ -143,6 +147,9 @@ void qio_net_listener_set_client_func_full(QIONetListener
> *listener,
> {
> size_t i;
>
> + if (listener->io_func) {
> + trace_qio_net_listener_watch_disabled(listener, "set_client_func");
> + }
> if (listener->io_notify) {
> listener->io_notify(listener->io_data);
> }
...while everywhere else you only call it with a non-NULL
listener->io_func.
Kevin