159e378cbb
GitOrigin-RevId: c04d5652cfa9742b1d519688f65d1bbccea9eb7e
45 lines
1.7 KiB
Diff
45 lines
1.7 KiB
Diff
diff --git a/qga/commands-posix.c b/qga/commands-posix.c
|
|
index c2bd0b4316..47cee1c351 100644
|
|
--- a/qga/commands-posix.c
|
|
+++ b/qga/commands-posix.c
|
|
@@ -246,7 +246,7 @@ void qmp_guest_shutdown(const char *mode, Error **errp)
|
|
return;
|
|
}
|
|
|
|
- const char *argv[] = {"/sbin/shutdown",
|
|
+ const char *argv[] = {"/run/current-system/sw/bin/shutdown",
|
|
#ifdef CONFIG_SOLARIS
|
|
shutdown_flag, "-g0", "-y",
|
|
#elif defined(CONFIG_BSD)
|
|
@@ -257,6 +257,10 @@ void qmp_guest_shutdown(const char *mode, Error **errp)
|
|
"hypervisor initiated shutdown", (char *) NULL};
|
|
|
|
ga_run_command(argv, NULL, "shutdown", &local_err);
|
|
+ if (local_err) {
|
|
+ argv[0] = "/sbin/shutdown";
|
|
+ ga_run_command(argv, NULL, "shutdown", &local_err);
|
|
+ }
|
|
if (local_err) {
|
|
error_propagate(errp, local_err);
|
|
return;
|
|
@@ -270,7 +274,7 @@ void qmp_guest_set_time(bool has_time, int64_t time_ns, Error **errp)
|
|
int ret;
|
|
Error *local_err = NULL;
|
|
struct timeval tv;
|
|
- const char *argv[] = {"/sbin/hwclock", has_time ? "-w" : "-s", NULL};
|
|
+ const char *argv[] = {"/run/current-system/sw/bin/hwclock", has_time ? "-w" : "-s", NULL};
|
|
|
|
/* If user has passed a time, validate and set it. */
|
|
if (has_time) {
|
|
@@ -303,6 +307,11 @@ void qmp_guest_set_time(bool has_time, int64_t time_ns, Error **errp)
|
|
* hardware clock (RTC). */
|
|
ga_run_command(argv, NULL, "set hardware clock to system time",
|
|
&local_err);
|
|
+ if (local_err) {
|
|
+ argv[0] = "/sbin/hwclock";
|
|
+ ga_run_command(argv, NULL, "set hardware clock to system time",
|
|
+ &local_err);
|
|
+ }
|
|
if (local_err) {
|
|
error_propagate(errp, local_err);
|
|
return;
|