git.iko.soy/typeable/nixpkgs
on master help sign in
qemu: add path to bin utilites
commite2c98528e93594512261c18f46474bcec1663581 authorIzorkin <Izorkin@gmail.com> dateFri 10 Aug 2018, 21:59 (8 years ago) parent6e3d0ef
2 files changed+26−2
pkgs/applications/virtualization/qemu/default.nix+4−2 pkgs/applications/virtualization/qemu/fix-qemu-ga.patch+22
pkgs/applications/virtualization/qemu/default.nix+4−2
@@ -71,8 +71,10 @@ stdenv.mkDerivation rec {
7171
7272 outputs = [ "out" "ga" ];
7373
74− patches = [ ./no-etc-install.patch ]
75− ++ optional nixosTestRunner ./force-uid0-on-9p.patch
74+ patches = [
75+ ./no-etc-install.patch
76+ ./fix-qemu-ga.patch
77+ ] ++ optional nixosTestRunner ./force-uid0-on-9p.patch
7678 ++ optional pulseSupport ./fix-hda-recording.patch
7779 ++ optionals stdenv.hostPlatform.isMusl [
7880 (fetchpatch {
pkgs/applications/virtualization/qemu/fix-qemu-ga.patchnew file+22
@@ -0,0 +1,22 @@
1+diff --git a/qga/commands-posix.c b/qga/commands-posix.c
2+index 0dc219d..9d020d3 100644
3+--- a/qga/commands-posix.c
4++++ b/qga/commands-posix.c
5+@@ -102,6 +102,8 @@ void qmp_guest_shutdown(bool has_mode, const char *mode, Error **errp)
6+ reopen_fd_to_null(1);
7+ reopen_fd_to_null(2);
8+
9++ execle("/run/current-system/sw/bin/shutdown", "shutdown", "-h", shutdown_flag, "+0",
10++ "hypervisor initiated shutdown", (char*)NULL, environ);
11+ execle("/sbin/shutdown", "shutdown", "-h", shutdown_flag, "+0",
12+ "hypervisor initiated shutdown", (char*)NULL, environ);
13+ _exit(EXIT_FAILURE);
14+@@ -189,6 +191,8 @@ void qmp_guest_set_time(bool has_time, int64_t time_ns, Error **errp)
15+
16+ /* Use '/sbin/hwclock -w' to set RTC from the system time,
17+ * or '/sbin/hwclock -s' to set the system time from RTC. */
18++ execle("/run/current-system/sw/bin/hwclock", "hwclock", has_time ? "-w" : "-s",
19++ NULL, environ);
20+ execle("/sbin/hwclock", "hwclock", has_time ? "-w" : "-s",
21+ NULL, environ);
22+ _exit(EXIT_FAILURE);