Merge pull request #24148 from volth/libvirt-3.1.0

libvirt: 3.0.0 -> 3.1.0
This commit is contained in:
Franz Pletz 2017-03-27 10:02:06 +02:00 committed by GitHub
commit 1b95985b71
5 changed files with 51 additions and 31 deletions

View File

@ -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" ];

View File

@ -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 ];
};
}

View File

@ -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 = ''

View File

@ -1,11 +1,14 @@
{ 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
}:
with stdenv.lib;
# if you update, also bump pythonPackages.libvirt or it will break
stdenv.mkDerivation rec {
name = "libvirt-${version}";
@ -21,16 +24,16 @@ 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
] ++ 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 [
libnl numad numactl xen zfs libapparmor
] ++ 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,16 @@ stdenv.mkDerivation rec {
"--with-test"
"--with-esx"
"--with-remote"
] ++ stdenv.lib.optionals stdenv.isLinux [
] ++ optionals stdenv.isLinux [
"--with-attr"
"--with-apparmor"
"--with-secdriver-apparmor"
"--with-numad"
"--with-macvtap"
"--with-virtualport"
"--with-init-script=redhat"
"--with-init-script=systemd+redhat"
"--with-storage-zfs"
] ++ stdenv.lib.optionals stdenv.isDarwin [
] ++ optionals stdenv.isDarwin [
"--with-init-script=none"
];
@ -66,17 +72,19 @@ 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"
'' + stdenv.lib.optionalString stdenv.isLinux ''
--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 : ${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 = ''

View File

@ -29039,13 +29039,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 ];