From 1cca97cf1864605e5163b298c43b5d2f6b3ff4c1 Mon Sep 17 00:00:00 2001 From: Volth Date: Thu, 23 Mar 2017 15:26:37 -0500 Subject: libvirt: 3.0.0 -> 3.1.0 --- pkgs/development/libraries/libvirt/default.nix | 19 +++++++++++-------- pkgs/top-level/python-packages.nix | 4 ++-- 2 files changed, 13 insertions(+), 10 deletions(-) (limited to 'pkgs') diff --git a/pkgs/development/libraries/libvirt/default.nix b/pkgs/development/libraries/libvirt/default.nix index 5fcdd153c99c..2c5d6350315b 100644 --- a/pkgs/development/libraries/libvirt/default.nix +++ b/pkgs/development/libraries/libvirt/default.nix @@ -6,6 +6,9 @@ , dnsmasq, libnl, libpcap, libxslt, xhtml1, numad, numactl, perlPackages , curl, libiconv, gmp, xen, zfs }: + +with stdenv.lib; + # if you update, also bump pythonPackages.libvirt or it will break stdenv.mkDerivation rec { name = "libvirt-${version}"; @@ -23,14 +26,14 @@ stdenv.mkDerivation rec { libxml2 gnutls perl python2 readline gettext libtasn1 libgcrypt yajl libxslt xhtml1 perlPackages.XMLXPath curl libpcap - ] ++ stdenv.lib.optionals stdenv.isLinux [ + ] ++ optionals stdenv.isLinux [ libpciaccess devicemapper lvm2 utillinux systemd libcap_ng libnl numad numactl xen zfs - ] ++ stdenv.lib.optionals stdenv.isDarwin [ + ] ++ optionals stdenv.isDarwin [ libiconv gmp ]; - preConfigure = stdenv.lib.optionalString stdenv.isLinux '' + preConfigure = optionalString stdenv.isLinux '' PATH=${stdenv.lib.makeBinPath [ iproute iptables ebtables lvm2 systemd ]}:$PATH substituteInPlace configure \ --replace 'as_dummy="/bin:/usr/bin:/usr/sbin"' 'as_dummy="${numad}/bin"' @@ -48,13 +51,13 @@ stdenv.mkDerivation rec { "--with-test" "--with-esx" "--with-remote" - ] ++ stdenv.lib.optionals stdenv.isLinux [ + ] ++ optionals stdenv.isLinux [ "--with-numad" "--with-macvtap" "--with-virtualport" "--with-init-script=redhat" "--with-storage-zfs" - ] ++ stdenv.lib.optionals stdenv.isDarwin [ + ] ++ optionals stdenv.isDarwin [ "--with-init-script=none" ]; @@ -67,16 +70,16 @@ stdenv.mkDerivation rec { sed -i 's/ON_SHUTDOWN=suspend/ON_SHUTDOWN=''${ON_SHUTDOWN:-suspend}/' $out/libexec/libvirt-guests.sh substituteInPlace $out/libexec/libvirt-guests.sh \ --replace "$out/bin" "${gettext}/bin" - '' + stdenv.lib.optionalString stdenv.isLinux '' + '' + optionalString stdenv.isLinux '' wrapProgram $out/sbin/libvirtd \ - --prefix PATH : ${stdenv.lib.makeBinPath [ iptables iproute pmutils numad numactl ]} + --prefix PATH : ${makeBinPath [ iptables iproute pmutils numad numactl ]} ''; enableParallelBuilding = true; NIX_CFLAGS_COMPILE = "-fno-stack-protector"; - meta = with stdenv.lib; { + meta = { homepage = http://libvirt.org/; repositories.git = git://libvirt.org/libvirt.git; description = '' diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 3bc3732d9f0d..9f6d1b9ddb71 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -29067,13 +29067,13 @@ EOF }; libvirt = let - version = "3.0.0"; + version = "3.1.0"; in assert version == pkgs.libvirt.version; pkgs.stdenv.mkDerivation rec { name = "libvirt-python-${version}"; src = pkgs.fetchurl { url = "http://libvirt.org/sources/python/${name}.tar.gz"; - sha256 = "1ha4bqf029si1lla1z7ca786w571fh3wfs4h7zaglfk4gb2w39wl"; + sha256 = "06524dhm27fjfnmr5bqdxlmm1g9ixvzaaq572hgyy5dqwfn64spk"; }; buildInputs = with self; [ python pkgs.pkgconfig pkgs.libvirt lxml ]; -- cgit 1.4.1 From 160fd7231ed57d9b5c1216d2b511478b80b08130 Mon Sep 17 00:00:00 2001 From: Franz Pletz Date: Sat, 25 Mar 2017 14:57:45 +0100 Subject: virt-manager: needs file for building translations --- pkgs/applications/virtualization/virt-manager/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'pkgs') diff --git a/pkgs/applications/virtualization/virt-manager/default.nix b/pkgs/applications/virtualization/virt-manager/default.nix index 787729d3afc9..3efcf6e582c6 100644 --- a/pkgs/applications/virtualization/virt-manager/default.nix +++ b/pkgs/applications/virtualization/virt-manager/default.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchurl, python2Packages, intltool, curl +{ stdenv, fetchurl, python2Packages, intltool, curl, file , wrapGAppsHook, virtinst, gtkvnc, vte , gtk3, gobjectIntrospection, libvirt-glib, gsettings_desktop_schemas, glib , avahi, dconf, spiceSupport ? true, spice_gtk, libosinfo, gnome3, system-libvirt @@ -27,7 +27,7 @@ buildPythonApplication rec { wrapGAppsHook ] ++ optional spiceSupport spice_gtk; - buildInputs = [ dconf avahi intltool ]; + buildInputs = [ dconf avahi intltool file ]; patchPhase = '' sed -i 's|/usr/share/libvirt/cpu_map.xml|${system-libvirt}/share/libvirt/cpu_map.xml|g' virtinst/capabilities.py @@ -54,6 +54,6 @@ buildPythonApplication rec { manages Xen and LXC (linux containers). ''; license = licenses.gpl2; - maintainers = with maintainers; [qknight offline]; + maintainers = with maintainers; [ qknight offline fpletz ]; }; } -- cgit 1.4.1 From ddb608814a4d13fcbdc0f1dc5da71f2363a88d3d Mon Sep 17 00:00:00 2001 From: Franz Pletz Date: Sat, 25 Mar 2017 14:58:26 +0100 Subject: libvirt: build with attr and apparmor --- pkgs/development/libraries/libvirt-glib/default.nix | 6 ++++-- pkgs/development/libraries/libvirt/default.nix | 11 +++++++---- 2 files changed, 11 insertions(+), 6 deletions(-) (limited to 'pkgs') diff --git a/pkgs/development/libraries/libvirt-glib/default.nix b/pkgs/development/libraries/libvirt-glib/default.nix index 0018e38a9f95..8cebaeee2afd 100644 --- a/pkgs/development/libraries/libvirt-glib/default.nix +++ b/pkgs/development/libraries/libvirt-glib/default.nix @@ -1,6 +1,6 @@ { stdenv, fetchurl, pkgconfig, libvirt, glib, libxml2, intltool, libtool, yajl , nettle, libgcrypt, pythonPackages, gobjectIntrospection, libcap_ng, numactl -, xen +, xen, libapparmor }: let @@ -15,9 +15,11 @@ in stdenv.mkDerivation rec { buildInputs = [ pkgconfig libvirt glib libxml2 intltool libtool yajl nettle libgcrypt - python pygobject2 gobjectIntrospection libcap_ng numactl xen + python pygobject2 gobjectIntrospection libcap_ng numactl xen libapparmor ]; + enableParallelBuilding = true; + meta = with stdenv.lib; { description = "Library for working with virtual machines"; longDescription = '' diff --git a/pkgs/development/libraries/libvirt/default.nix b/pkgs/development/libraries/libvirt/default.nix index 2c5d6350315b..08a70b5514d3 100644 --- a/pkgs/development/libraries/libvirt/default.nix +++ b/pkgs/development/libraries/libvirt/default.nix @@ -1,8 +1,8 @@ { stdenv, fetchurl, fetchpatch , pkgconfig, makeWrapper -, libxml2, gnutls, devicemapper, perl, python2 +, libxml2, gnutls, devicemapper, perl, python2, attr , iproute, iptables, readline, lvm2, utillinux, systemd, libpciaccess, gettext -, libtasn1, ebtables, libgcrypt, yajl, pmutils, libcap_ng +, libtasn1, ebtables, libgcrypt, yajl, pmutils, libcap_ng, libapparmor , dnsmasq, libnl, libpcap, libxslt, xhtml1, numad, numactl, perlPackages , curl, libiconv, gmp, xen, zfs }: @@ -24,11 +24,11 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ makeWrapper pkgconfig ]; buildInputs = [ libxml2 gnutls perl python2 readline - gettext libtasn1 libgcrypt yajl + gettext libtasn1 libgcrypt yajl attr libxslt xhtml1 perlPackages.XMLXPath curl libpcap ] ++ optionals stdenv.isLinux [ libpciaccess devicemapper lvm2 utillinux systemd libcap_ng - libnl numad numactl xen zfs + libnl numad numactl xen zfs libapparmor ] ++ optionals stdenv.isDarwin [ libiconv gmp ]; @@ -52,6 +52,9 @@ stdenv.mkDerivation rec { "--with-esx" "--with-remote" ] ++ optionals stdenv.isLinux [ + "--with-attr" + "--with-apparmor" + "--with-secdriver-apparmor" "--with-numad" "--with-macvtap" "--with-virtualport" -- cgit 1.4.1 From d545772640d13e0d2d984ad582888deda7cefa86 Mon Sep 17 00:00:00 2001 From: Franz Pletz Date: Sat, 25 Mar 2017 14:59:01 +0100 Subject: libvirt: make guest suspend work, use upstream units --- nixos/modules/virtualisation/libvirtd.nix | 30 +++++++++++++++++--------- pkgs/development/libraries/libvirt/default.nix | 6 ++++-- 2 files changed, 24 insertions(+), 12 deletions(-) (limited to 'pkgs') diff --git a/nixos/modules/virtualisation/libvirtd.nix b/nixos/modules/virtualisation/libvirtd.nix index 101ea9a4f51b..c0cebaddec8d 100644 --- a/nixos/modules/virtualisation/libvirtd.nix +++ b/nixos/modules/virtualisation/libvirtd.nix @@ -90,14 +90,16 @@ in { config = mkIf cfg.enable { - environment.systemPackages = - [ pkgs.libvirt pkgs.netcat-openbsd ] - ++ optional cfg.enableKVM pkgs.qemu_kvm; + environment.systemPackages = with pkgs; + [ libvirt netcat-openbsd ] + ++ optional cfg.enableKVM qemu_kvm; boot.kernelModules = [ "tun" ]; users.extraGroups.libvirtd.gid = config.ids.gids.libvirtd; + systemd.packages = [ pkgs.libvirt ]; + systemd.services.libvirtd = { description = "Libvirt Virtual Machine Management Daemon"; @@ -105,13 +107,17 @@ in { after = [ "systemd-udev-settle.service" ] ++ optional vswitch.enable "vswitchd.service"; - path = [ - pkgs.bridge-utils - pkgs.dmidecode - pkgs.dnsmasq - pkgs.ebtables + environment = { + LIBVIRTD_ARGS = ''--config "${configFile}" ${concatStringsSep " " cfg.extraOptions}''; + }; + + path = with pkgs; [ + bridge-utils + dmidecode + dnsmasq + ebtables ] - ++ optional cfg.enableKVM pkgs.qemu_kvm + ++ optional cfg.enableKVM qemu_kvm ++ optional vswitch.enable vswitch.package; preStart = '' @@ -153,13 +159,17 @@ in { ''; # */ serviceConfig = { - ExecStart = ''@${pkgs.libvirt}/sbin/libvirtd libvirtd --config "${configFile}" ${concatStringsSep " " cfg.extraOptions}''; Type = "notify"; KillMode = "process"; # when stopping, leave the VMs alone Restart = "on-failure"; }; }; + systemd.services.libvirt-guests = { + wantedBy = [ "multi-user.target" ]; + path = with pkgs; [ coreutils libvirt gawk ]; + }; + systemd.sockets.virtlogd = { description = "Virtual machine log manager socket"; wantedBy = [ "sockets.target" ]; diff --git a/pkgs/development/libraries/libvirt/default.nix b/pkgs/development/libraries/libvirt/default.nix index 08a70b5514d3..aa044c885ea5 100644 --- a/pkgs/development/libraries/libvirt/default.nix +++ b/pkgs/development/libraries/libvirt/default.nix @@ -58,7 +58,7 @@ stdenv.mkDerivation rec { "--with-numad" "--with-macvtap" "--with-virtualport" - "--with-init-script=redhat" + "--with-init-script=systemd+redhat" "--with-storage-zfs" ] ++ optionals stdenv.isDarwin [ "--with-init-script=none" @@ -72,7 +72,9 @@ stdenv.mkDerivation rec { postInstall = '' sed -i 's/ON_SHUTDOWN=suspend/ON_SHUTDOWN=''${ON_SHUTDOWN:-suspend}/' $out/libexec/libvirt-guests.sh substituteInPlace $out/libexec/libvirt-guests.sh \ - --replace "$out/bin" "${gettext}/bin" + --replace "$out/bin" "${gettext}/bin" \ + --replace "lock/subsys" "lock" + rm $out/lib/systemd/system/{virtlockd,virtlogd}.* '' + optionalString stdenv.isLinux '' wrapProgram $out/sbin/libvirtd \ --prefix PATH : ${makeBinPath [ iptables iproute pmutils numad numactl ]} -- cgit 1.4.1