mirror_qemu/monitor
Marc-André Lureau bf5de8c5d6 qmp: 'add_client' actually expects sockets
Whether it is SPICE, VNC, D-Bus, or the socket chardev, they all
actually expect a socket kind or will fail in different ways at runtime.

Throw an error early if the given 'add_client' fd is not a socket, and
close it to avoid leaks.

This allows to replace the close() call with a more correct & portable
closesocket() version.

(this will allow importing sockets on Windows with a specialized command
in the following patch, while keeping the remaining monitor associated
sockets/add_client code & usage untouched)

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Acked-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20230306122751.2355515-6-marcandre.lureau@redhat.com>
2023-03-13 15:40:41 +04:00
..
fds.c monitor: Split file descriptor passing stuff off misc.c 2023-02-04 07:56:54 +01:00
hmp-cmds-target.c monitor: Move target-dependent HMP commands to hmp-cmds-target.c 2023-02-04 07:56:54 +01:00
hmp-cmds.c monitor: Move remaining HMP commands from misc.c to hmp-cmds.c 2023-02-04 07:56:54 +01:00
hmp-target.c monitor: Rename misc.c to hmp-target.c 2023-02-04 07:56:54 +01:00
hmp.c readline: fix hmp completion issue 2023-03-01 20:46:07 +01:00
meson.build monitor: Rename misc.c to hmp-target.c 2023-02-04 07:56:54 +01:00
monitor-internal.h hmp: Rename help_cmd() to hmp_help_cmd(), move declaration to hmp.h 2023-02-04 07:56:54 +01:00
monitor.c monitor: Loosen coupling between misc.c and monitor.c slightly 2023-02-04 07:56:54 +01:00
qmp-cmds-control.c monitor: Drop unnecessary includes 2023-02-04 07:56:52 +01:00
qmp-cmds.c qmp: 'add_client' actually expects sockets 2023-03-13 15:40:41 +04:00
qmp.c monitor/qmp: fix race on CHR_EVENT_CLOSED without OOB 2021-05-12 17:29:11 +02:00
trace-events docs: fix references to docs/devel/tracing.rst 2021-06-02 06:51:09 +02:00
trace.h trace: switch position of headers to what Meson requires 2020-08-21 06:18:24 -04:00