From 05e50e8fe5fed707653e1e5e2f2871f253a70452 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Date: Mon, 25 Apr 2022 12:53:37 +0400 Subject: io: make qio_channel_command_new_pid() static MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The function isn't used outside of qio_channel_command_new_spawn(), which is !win32-specific. Signed-off-by: Marc-André Lureau Reviewed-by: Richard Henderson --- include/io/channel-command.h | 25 ------------------------- io/channel-command.c | 26 ++++++++++++++++++++++---- 2 files changed, 22 insertions(+), 29 deletions(-) diff --git a/include/io/channel-command.h b/include/io/channel-command.h index 27e42bd..305ac1d 100644 --- a/include/io/channel-command.h +++ b/include/io/channel-command.h @@ -46,31 +46,6 @@ struct QIOChannelCommand { /** - * qio_channel_command_new_pid: - * @writefd: the FD connected to the command's stdin - * @readfd: the FD connected to the command's stdout - * @pid: the PID of the running child command - * @errp: pointer to a NULL-initialized error object - * - * Create a channel for performing I/O with the - * previously spawned command identified by @pid. - * The two file descriptors provide the connection - * to command's stdio streams, either one or which - * may be -1 to indicate that stream is not open. - * - * The channel will take ownership of the process - * @pid and will kill it when closing the channel. - * Similarly it will take responsibility for - * closing the file descriptors @writefd and @readfd. - * - * Returns: the command channel object, or NULL on error - */ -QIOChannelCommand * -qio_channel_command_new_pid(int writefd, - int readfd, - pid_t pid); - -/** * qio_channel_command_new_spawn: * @argv: the NULL terminated list of command arguments * @flags: the I/O mode, one of O_RDONLY, O_WRONLY, O_RDWR diff --git a/io/channel-command.c b/io/channel-command.c index 539685e..0790ac7 100644 --- a/io/channel-command.c +++ b/io/channel-command.c @@ -26,8 +26,28 @@ #include "qemu/sockets.h" #include "trace.h" - -QIOChannelCommand * +#ifndef WIN32 +/** + * qio_channel_command_new_pid: + * @writefd: the FD connected to the command's stdin + * @readfd: the FD connected to the command's stdout + * @pid: the PID of the running child command + * @errp: pointer to a NULL-initialized error object + * + * Create a channel for performing I/O with the + * previously spawned command identified by @pid. + * The two file descriptors provide the connection + * to command's stdio streams, either one or which + * may be -1 to indicate that stream is not open. + * + * The channel will take ownership of the process + * @pid and will kill it when closing the channel. + * Similarly it will take responsibility for + * closing the file descriptors @writefd and @readfd. + * + * Returns: the command channel object, or NULL on error + */ +static QIOChannelCommand * qio_channel_command_new_pid(int writefd, int readfd, pid_t pid) @@ -44,8 +64,6 @@ qio_channel_command_new_pid(int writefd, return ioc; } - -#ifndef WIN32 QIOChannelCommand * qio_channel_command_new_spawn(const char *const argv[], int flags, -- cgit v1.1