projects/guix·blob python-team · refs

38 lines · 1.4 KiB

1diff --git a/qga/commands-posix.c b/qga/commands-posix.c
2index 837be51c40..d0d4d99b5e 100644
3--- a/qga/commands-posix.c
4+++ b/qga/commands-posix.c
5@@ -216,9 +216,9 @@ out:
6 return retcode;
7 }
8
9-#define POWEROFF_CMD_PATH "/sbin/poweroff"
10-#define HALT_CMD_PATH "/sbin/halt"
11-#define REBOOT_CMD_PATH "/sbin/reboot"
12+#define POWEROFF_CMD_PATH "/run/current-system/profile/sbin/shutdown"
13+#define HALT_CMD_PATH "/run/current-system/profile/sbin/halt"
14+#define REBOOT_CMD_PATH "/run/current-system/profile/sbin/reboot"
15
16 void qmp_guest_shutdown(const char *mode, Error **errp)
17 {
18@@ -295,7 +295,7 @@ void qmp_guest_set_time(bool has_time, int64_t time_ns, Error **errp)
19 int ret;
20 Error *local_err = NULL;
21 struct timeval tv;
22- const char *argv[] = {"/sbin/hwclock", has_time ? "-w" : "-s", NULL};
23+ const char *argv[] = {"/run/current-system/profile/sbin/hwclock", has_time ? "-w" : "-s", NULL};
24
25 /* If user has passed a time, validate and set it. */
26 if (has_time) {
27@@ -328,6 +328,11 @@ void qmp_guest_set_time(bool has_time, int64_t time_ns, Error **errp)
28 * hardware clock (RTC). */
29 ga_run_command(argv, NULL, "set hardware clock to system time",
30 &local_err);
31+ if (local_err) {
32+ argv[0] = "/sbin/hwclock";
33+ ga_run_command(argv, NULL, "set hardware clock to system time",
34+ &local_err);
35+ }
36 if (local_err) {
37 error_propagate(errp, local_err);
38 return;