summaryrefslogtreecommitdiff
path: root/gnu/packages/patches/qemu-fix-agent-paths.patch
blob: 9ace7000251fa683d9d391694dd3c2b5214263b4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
diff --git a/qga/commands-posix.c b/qga/commands-posix.c
index 837be51c40..d0d4d99b5e 100644
--- a/qga/commands-posix.c
+++ b/qga/commands-posix.c
@@ -216,9 +216,9 @@ out:
     return retcode;
 }
 
-#define POWEROFF_CMD_PATH "/sbin/poweroff"
-#define HALT_CMD_PATH "/sbin/halt"
-#define REBOOT_CMD_PATH "/sbin/reboot"
+#define POWEROFF_CMD_PATH "/run/current-system/profile/sbin/shutdown"
+#define HALT_CMD_PATH "/run/current-system/profile/sbin/halt"
+#define REBOOT_CMD_PATH "/run/current-system/profile/sbin/reboot"
 
 void qmp_guest_shutdown(const char *mode, Error **errp)
 {
@@ -295,7 +295,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/profile/sbin/hwclock", has_time ? "-w" : "-s", NULL};
 
     /* If user has passed a time, validate and set it. */
     if (has_time) {
@@ -328,6 +328,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;