From d12e937f47c72cecacbb8d8bc965d3ab6d7d2dac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Date: Tue, 7 Jan 2025 11:37:57 +0000 Subject: [PATCH] tools: fix ordering mistake in virt-admin daemon-set-timeout code MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Most of the impl for the 'daemon-set-timeout' command was ordered under the heading for the 'daemon-log-filters' command. Reviewed-by: Martin Kletzander Signed-off-by: Daniel P. Berrangé --- tools/virt-admin.c | 71 +++++++++++++++++++++++----------------------- 1 file changed, 36 insertions(+), 35 deletions(-) diff --git a/tools/virt-admin.c b/tools/virt-admin.c index 3eb4f0f3fd..325b7aa827 100644 --- a/tools/virt-admin.c +++ b/tools/virt-admin.c @@ -1005,41 +1005,6 @@ static const vshCmdInfo info_daemon_log_outputs = { "daemon."), }; -static const vshCmdOptDef opts_daemon_timeout[] = { - {.name = "timeout", - .type = VSH_OT_INT, - .required = true, - .positional = true, - .help = N_("number of seconds the daemon will run without any active connection"), - }, - {.name = NULL} -}; - -static bool -cmdDaemonTimeout(vshControl *ctl, const vshCmd *cmd) -{ - vshAdmControl *priv = ctl->privData; - unsigned int timeout = 0; - - if (vshCommandOptUInt(ctl, cmd, "timeout", &timeout) < 0) - return false; - - if (virAdmConnectSetDaemonTimeout(priv->conn, timeout, 0) < 0) - return false; - - return true; -} - - -/* -------------------------- - * Command daemon-timeout - * -------------------------- - */ -static const vshCmdInfo info_daemon_timeout = { - .help = N_("set the auto shutdown timeout of the daemon"), - .desc = N_("set the auto shutdown timeout of the daemon"), -}; - static const vshCmdOptDef opts_daemon_log_outputs[] = { {.name = "outputs", .type = VSH_OT_STRING, @@ -1076,6 +1041,42 @@ cmdDaemonLogOutputs(vshControl *ctl, const vshCmd *cmd) return true; } + +/* -------------------------- + * Command daemon-timeout + * -------------------------- + */ +static const vshCmdInfo info_daemon_timeout = { + .help = N_("set the auto shutdown timeout of the daemon"), + .desc = N_("set the auto shutdown timeout of the daemon"), +}; + +static const vshCmdOptDef opts_daemon_timeout[] = { + {.name = "timeout", + .type = VSH_OT_INT, + .required = true, + .positional = true, + .help = N_("number of seconds the daemon will run without any active connection"), + }, + {.name = NULL} +}; + +static bool +cmdDaemonTimeout(vshControl *ctl, const vshCmd *cmd) +{ + vshAdmControl *priv = ctl->privData; + unsigned int timeout = 0; + + if (vshCommandOptUInt(ctl, cmd, "timeout", &timeout) < 0) + return false; + + if (virAdmConnectSetDaemonTimeout(priv->conn, timeout, 0) < 0) + return false; + + return true; +} + + static void * vshAdmConnectionHandler(vshControl *ctl) {