From d016a64de25d69b7931a1b6a411125de250fee7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A1n=20Tomko?= Date: Wed, 22 Apr 2020 16:20:10 +0200 Subject: [PATCH] util: remove virRun MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Everything is using virCommand now. Signed-off-by: Ján Tomko Reviewed-by: Michal Privoznik --- src/libvirt_private.syms | 1 - src/util/vircommand.c | 35 ----------------------------------- src/util/vircommand.h | 2 -- 3 files changed, 38 deletions(-) diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index c43e8b0ca6..a9694f34c0 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -1876,7 +1876,6 @@ virCommandToString; virCommandWait; virCommandWriteArgLog; virFork; -virRun; # util/virconf.h diff --git a/src/util/vircommand.c b/src/util/vircommand.c index b84fb40948..20f196104f 100644 --- a/src/util/vircommand.c +++ b/src/util/vircommand.c @@ -893,43 +893,8 @@ virExec(virCommandPtr cmd) } -/** - * virRun: - * @argv NULL terminated argv to run - * @status optional variable to return exit status in - * - * Run a command without using the shell. - * - * If status is NULL, then return 0 if the command run and - * exited with 0 status; Otherwise return -1 - * - * If status is not-NULL, then return 0 if the command ran. - * The status variable is filled with the command exit status - * and should be checked by caller for success. Return -1 - * only if the command could not be run. - */ -int -virRun(const char *const*argv, int *status) -{ - g_autoptr(virCommand) cmd = virCommandNewArgs(argv); - - return virCommandRun(cmd, status); -} - #else /* WIN32 */ -int -virRun(const char *const *argv G_GNUC_UNUSED, - int *status) -{ - if (status) - *status = ENOTSUP; - else - virReportError(VIR_ERR_INTERNAL_ERROR, - "%s", _("virRun is not implemented for WIN32")); - return -1; -} - pid_t virFork(void) { diff --git a/src/util/vircommand.h b/src/util/vircommand.h index 9086f9a90c..e2be5bcf1c 100644 --- a/src/util/vircommand.h +++ b/src/util/vircommand.h @@ -34,8 +34,6 @@ typedef int (*virExecHook)(void *data); pid_t virFork(void) G_GNUC_WARN_UNUSED_RESULT; -int virRun(const char *const*argv, int *status) G_GNUC_WARN_UNUSED_RESULT; - virCommandPtr virCommandNew(const char *binary) ATTRIBUTE_NONNULL(1); virCommandPtr virCommandNewArgs(const char *const*args) ATTRIBUTE_NONNULL(1); -- GitLab