diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2019-12-13 09:51:16 +0000 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2019-12-13 09:51:16 +0000 |
commit | 5d6567e1da25bec0b85d3de14893618c885d9889 (patch) | |
tree | a6fd2b01b5650119b9d01b49de03b1bc98c2300a /community/qemu/guest-agent-shutdown.patch | |
parent | 8da2624dad504d761040aee449a97941b1c4930c (diff) | |
download | aports-5d6567e1da25bec0b85d3de14893618c885d9889.tar.bz2 aports-5d6567e1da25bec0b85d3de14893618c885d9889.tar.xz |
community/{qemu*,ceph}: move to community
move qemu and ceph to community. Thi sis to reduce maintenenance
workload for security fixes. Upstream qemu appears to have less support
time than 2 years.
Diffstat (limited to 'community/qemu/guest-agent-shutdown.patch')
-rw-r--r-- | community/qemu/guest-agent-shutdown.patch | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/community/qemu/guest-agent-shutdown.patch b/community/qemu/guest-agent-shutdown.patch new file mode 100644 index 0000000000..742f281447 --- /dev/null +++ b/community/qemu/guest-agent-shutdown.patch @@ -0,0 +1,34 @@ +diff --git a/qga/commands-posix.c b/qga/commands-posix.c +index 1877976..7915aab 100644 +--- a/qga/commands-posix.c ++++ b/qga/commands-posix.c +@@ -82,6 +82,7 @@ static void ga_wait_child(pid_t pid, int *status, Error **errp) + void qmp_guest_shutdown(bool has_mode, const char *mode, Error **errp) + { + const char *shutdown_flag; ++ const char *fallback_cmd = NULL; + Error *local_err = NULL; + pid_t pid; + int status; +@@ -89,10 +90,13 @@ void qmp_guest_shutdown(bool has_mode, const char *mode, Error **errp) + slog("guest-shutdown called, mode: %s", mode); + if (!has_mode || strcmp(mode, "powerdown") == 0) { + shutdown_flag = "-P"; ++ fallback_cmd = "/sbin/poweroff"; + } else if (strcmp(mode, "halt") == 0) { + shutdown_flag = "-H"; ++ fallback_cmd = "/sbin/halt"; + } else if (strcmp(mode, "reboot") == 0) { + shutdown_flag = "-r"; ++ fallback_cmd = "/sbin/reboot"; + } else { + error_setg(errp, + "mode is invalid (valid values are: halt|powerdown|reboot"); +@@ -109,6 +113,7 @@ void qmp_guest_shutdown(bool has_mode, const char *mode, Error **errp) + + execle("/sbin/shutdown", "shutdown", "-h", shutdown_flag, "+0", + "hypervisor initiated shutdown", (char*)NULL, environ); ++ execle(fallback_cmd, fallback_cmd, (char*)NULL, environ); + _exit(EXIT_FAILURE); + } else if (pid < 0) { + error_setg_errno(errp, errno, "failed to create child process"); |