From: "Daniel P. Berrangé" <berrange@redhat.com>
To: Thomas Dreibholz <dreibh@simula.no>
Cc: qemu-devel@nongnu.org, Michael Roth <michael.roth@amd.com>,
Kostiantyn Kostiuk <kkostiuk@redhat.com>
Subject: Re: [PATCH] Fix for https://gitlab.com/qemu-project/qemu/-/work_items/4141:
Date: Mon, 10 Aug 2026 10:33:37 +0100 [thread overview]
Message-ID: <anma8SUZlGZinwtB@redhat.com> (raw)
In-Reply-To: <20260808-solaris-qga-fix-b4-v1-1-80eafc48246c@simula.no>
Please use a $SUBJECT that describes what you're fixing
"Fix shutdown command path not found on Solaris"
On Sat, Aug 08, 2026 at 12:34:06PM +0200, Thomas Dreibholz wrote:
> Using the correct paths for "shutdown", "reboot", etc. under Solaris.
>
> Signed-off-by: Thomas Dreibholz <dreibh@simula.no>
> ---
> This patch fixes the issue of the not-working shutdown command
> in the QEMU Guest Agent under Solaris
> (https://gitlab.com/qemu-project/qemu/-/work_items/4141) by
> fixing the command paths from /sbin/ to /usr/sbin/ in the
> Solaris build.
> ---
> qga/commands-posix.c | 16 ++++++++++++----
> 1 file changed, 12 insertions(+), 4 deletions(-)
>
> diff --git a/qga/commands-posix.c b/qga/commands-posix.c
> index 837be51c40..e24248a0f3 100644
> --- a/qga/commands-posix.c
> +++ b/qga/commands-posix.c
> @@ -216,9 +216,17 @@ out:
> return retcode;
> }
>
> +#ifdef CONFIG_SOLARIS
> +#define POWEROFF_CMD_PATH "/usr/sbin/poweroff"
> +#define SHUTDOWN_CMD_PATH "/usr/sbin/shutdown"
> +#define HALT_CMD_PATH "/usr/sbin/halt"
> +#define REBOOT_CMD_PATH "/usr/sbin/reboot"
> +#else
> #define POWEROFF_CMD_PATH "/sbin/poweroff"
> -#define HALT_CMD_PATH "/sbin/halt"
> -#define REBOOT_CMD_PATH "/sbin/reboot"
> +#define SHUTDOWN_CMD_PATH "/sbin/shutdown"
> +#define HALT_CMD_PATH "/sbin/halt"
> +#define REBOOT_CMD_PATH "/sbin/reboot"
> +#endif
I wonder why we need to use a qualified path at all. We're passing these
to ga_run_command and that uses execvp, which searches $PATH.
qga runs as root and can be expected to have these in $PATH.
>
> void qmp_guest_shutdown(const char *mode, Error **errp)
> {
> @@ -262,7 +270,7 @@ void qmp_guest_shutdown(const char *mode, Error **errp)
> return;
> }
>
> - const char *argv[] = {"/sbin/shutdown",
> + const char *argv[] = {SHUTDOWN_CMD_PATH,
> #ifdef CONFIG_SOLARIS
> shutdown_flag, "-g0", "-y",
> #elif defined(CONFIG_BSD)
> @@ -274,7 +282,7 @@ void qmp_guest_shutdown(const char *mode, Error **errp)
>
> /*
> * If the specific command exists (poweroff, halt or reboot), use it instead
> - * of /sbin/shutdown.
> + * of SHUTDOWN_CMD_PATH.
> */
> if (shutdown_cmd != NULL) {
> argv[0] = shutdown_cmd;
With regards,
Daniel
--
|: https://berrange.com ~~ https://hachyderm.io/@berrange :|
|: https://libvirt.org ~~ https://entangle-photo.org :|
|: https://pixelfed.art/berrange ~~ https://fstop138.berrange.com :|
prev parent reply other threads:[~2026-08-10 9:34 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-08 10:34 [PATCH] Fix for https://gitlab.com/qemu-project/qemu/-/work_items/4141: Thomas Dreibholz
2026-08-10 9:33 ` Daniel P. Berrangé [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=anma8SUZlGZinwtB@redhat.com \
--to=berrange@redhat.com \
--cc=dreibh@simula.no \
--cc=kkostiuk@redhat.com \
--cc=michael.roth@amd.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.