@@ -1,6 +1,6 @@
11{ stdenv, fetchurl, fetchpatch
22, pkgconfig, makeWrapper
3−, libxml2, gnutls, devicemapper, perl, python2, attr
3+, coreutils, libxml2, gnutls, devicemapper, perl, python2, attr
44, iproute, iptables, readline, lvm2, utillinux, systemd, libpciaccess, gettext
55, libtasn1, ebtables, libgcrypt, yajl, pmutils, libcap_ng, libapparmor
66, dnsmasq, libnl, libpcap, libxslt, xhtml1, numad, numactl, perlPackages
@@ -12,11 +12,11 @@ with stdenv.lib;
1212# if you update, also bump pythonPackages.libvirt or it will break
1313stdenv.mkDerivation rec {
1414 name = "libvirt-${version}";
15− version = "3.5.0";
15+ version = "3.6.0";
1616
1717 src = fetchurl {
1818 url = "http://libvirt.org/sources/${name}.tar.xz";
19− sha256 = "05mm4xdw6g960rwvc9189nhxpm1vrilnmpl4h4m1lha11pivlqr9";
19+ sha256 = "0gcyql5dp6j370kvik9hjhxirrg89m7l1q52yq0g75h7jpv9fb1s";
2020 };
2121
2222 patches = [ ./build-on-bsd.patch ];
@@ -36,6 +36,13 @@ stdenv.mkDerivation rec {
3636 PATH=${stdenv.lib.makeBinPath [ iproute iptables ebtables lvm2 systemd ]}:$PATH
3737 substituteInPlace configure \
3838 --replace 'as_dummy="/bin:/usr/bin:/usr/sbin"' 'as_dummy="${numad}/bin"'
39+
40+ # the path to qemu-kvm will be stored in VM's .xml and .save files
41+ # do not use "''${qemu_kvm}/bin/qemu-kvm" to avoid bound VMs to particular qemu derivations
42+ substituteInPlace src/qemu/qemu_capabilities.c \
43+ --replace '"/usr/libexec/qemu-kvm"' '"/run/libvirt/nix-emulators/${if stdenv.isAarch64 then "qemu-system-aarch64" else "qemu-kvm"}"'
44+ substituteInPlace src/lxc/lxc_conf.c \
45+ --replace 'lxc_path,' '"/run/libvirt/nix-emulators/libvirt_lxc",'
3946 '' + ''
4047 PATH=${dnsmasq}/bin:$PATH
4148 patchShebangs . # fixes /usr/bin/python references
@@ -77,6 +84,8 @@ stdenv.mkDerivation rec {
7784 --replace "lock/subsys" "lock"
7885 sed -e "/gettext\.sh/a \\\n# Added in nixpkgs:\ngettext() { \"${gettext}/bin/gettext\" \"\$@\"; }" \
7986 -i "$out/libexec/libvirt-guests.sh"
87+
88+ substituteInPlace $out/lib/systemd/system/libvirtd.service --replace /bin/kill ${coreutils}/bin/kill
8089 '' + optionalString stdenv.isLinux ''
8190 rm $out/lib/systemd/system/{virtlockd,virtlogd}.*
8291 wrapProgram $out/sbin/libvirtd \