All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Fix for https://gitlab.com/qemu-project/qemu/-/work_items/4141:
@ 2026-08-08 10:34 Thomas Dreibholz
  2026-08-10  9:33 ` Daniel P. Berrangé
  0 siblings, 1 reply; 2+ messages in thread
From: Thomas Dreibholz @ 2026-08-08 10:34 UTC (permalink / raw)
  To: qemu-devel; +Cc: Thomas Dreibholz, Michael Roth, Kostiantyn Kostiuk

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
 
 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;

---
base-commit: 3e3ccab106f879b1512f8e0d51a827dd4de30e22
change-id: 20260808-solaris-qga-fix-b4-d25104a17fb7

Best regards,
-- 
Thomas Dreibholz <dreibh@simula.no>



^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-08-10  9:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 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.