0
0
Fork 0
mirror of https://github.com/NixOS/nixpkgs.git synced 2025-07-13 21:50:33 +03:00

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 { config = mkIf cfg.enable {
environment.systemPackages = environment.systemPackages = with pkgs;
[ pkgs.libvirt pkgs.netcat-openbsd ] [ libvirt netcat-openbsd ]
++ optional cfg.enableKVM pkgs.qemu_kvm; ++ optional cfg.enableKVM qemu_kvm;
boot.kernelModules = [ "tun" ]; boot.kernelModules = [ "tun" ];
users.extraGroups.libvirtd.gid = config.ids.gids.libvirtd; users.extraGroups.libvirtd.gid = config.ids.gids.libvirtd;
systemd.packages = [ pkgs.libvirt ];
systemd.services.libvirtd = { systemd.services.libvirtd = {
description = "Libvirt Virtual Machine Management Daemon"; description = "Libvirt Virtual Machine Management Daemon";
@ -105,13 +107,17 @@ in {
after = [ "systemd-udev-settle.service" ] after = [ "systemd-udev-settle.service" ]
++ optional vswitch.enable "vswitchd.service"; ++ optional vswitch.enable "vswitchd.service";
path = [ environment = {
pkgs.bridge-utils LIBVIRTD_ARGS = ''--config "${configFile}" ${concatStringsSep " " cfg.extraOptions}'';
pkgs.dmidecode };
pkgs.dnsmasq
pkgs.ebtables path = with pkgs; [
bridge-utils
dmidecode
dnsmasq
ebtables
] ]
++ optional cfg.enableKVM pkgs.qemu_kvm ++ optional cfg.enableKVM qemu_kvm
++ optional vswitch.enable vswitch.package; ++ optional vswitch.enable vswitch.package;
preStart = '' preStart = ''
@ -153,13 +159,17 @@ in {
''; # */ ''; # */
serviceConfig = { serviceConfig = {
ExecStart = ''@${pkgs.libvirt}/sbin/libvirtd libvirtd --config "${configFile}" ${concatStringsSep " " cfg.extraOptions}'';
Type = "notify"; Type = "notify";
KillMode = "process"; # when stopping, leave the VMs alone KillMode = "process"; # when stopping, leave the VMs alone
Restart = "on-failure"; Restart = "on-failure";
}; };
}; };
systemd.services.libvirt-guests = {
wantedBy = [ "multi-user.target" ];
path = with pkgs; [ coreutils libvirt gawk ];
};
systemd.sockets.virtlogd = { systemd.sockets.virtlogd = {
description = "Virtual machine log manager socket"; description = "Virtual machine log manager socket";
wantedBy = [ "sockets.target" ]; wantedBy = [ "sockets.target" ];

View file

@ -1,4 +1,4 @@
{ stdenv, fetchurl, python2Packages, intltool, curl { stdenv, fetchurl, python2Packages, intltool, curl, file
, wrapGAppsHook, virtinst, gtkvnc, vte , wrapGAppsHook, virtinst, gtkvnc, vte
, gtk3, gobjectIntrospection, libvirt-glib, gsettings_desktop_schemas, glib , gtk3, gobjectIntrospection, libvirt-glib, gsettings_desktop_schemas, glib
, avahi, dconf, spiceSupport ? true, spice_gtk, libosinfo, gnome3, system-libvirt , avahi, dconf, spiceSupport ? true, spice_gtk, libosinfo, gnome3, system-libvirt
@ -27,7 +27,7 @@ buildPythonApplication rec {
wrapGAppsHook wrapGAppsHook
] ++ optional spiceSupport spice_gtk; ] ++ optional spiceSupport spice_gtk;
buildInputs = [ dconf avahi intltool ]; buildInputs = [ dconf avahi intltool file ];
patchPhase = '' patchPhase = ''
sed -i 's|/usr/share/libvirt/cpu_map.xml|${system-libvirt}/share/libvirt/cpu_map.xml|g' virtinst/capabilities.py 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). manages Xen and LXC (linux containers).
''; '';
license = licenses.gpl2; 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 { stdenv, fetchurl, pkgconfig, libvirt, glib, libxml2, intltool, libtool, yajl
, nettle, libgcrypt, pythonPackages, gobjectIntrospection, libcap_ng, numactl , nettle, libgcrypt, pythonPackages, gobjectIntrospection, libcap_ng, numactl
, xen , xen, libapparmor
}: }:
let let
@ -15,9 +15,11 @@ in stdenv.mkDerivation rec {
buildInputs = [ buildInputs = [
pkgconfig libvirt glib libxml2 intltool libtool yajl nettle libgcrypt 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; { meta = with stdenv.lib; {
description = "Library for working with virtual machines"; description = "Library for working with virtual machines";
longDescription = '' longDescription = ''

View file

@ -1,11 +1,14 @@
{ stdenv, fetchurl, fetchpatch { stdenv, fetchurl, fetchpatch
, pkgconfig, makeWrapper , pkgconfig, makeWrapper
, libxml2, gnutls, devicemapper, perl, python2 , libxml2, gnutls, devicemapper, perl, python2, attr
, iproute, iptables, readline, lvm2, utillinux, systemd, libpciaccess, gettext , 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 , dnsmasq, libnl, libpcap, libxslt, xhtml1, numad, numactl, perlPackages
, curl, libiconv, gmp, xen, zfs , curl, libiconv, gmp, xen, zfs
}: }:
with stdenv.lib;
# if you update, also bump pythonPackages.libvirt or it will break # if you update, also bump pythonPackages.libvirt or it will break
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
name = "libvirt-${version}"; name = "libvirt-${version}";
@ -21,16 +24,16 @@ stdenv.mkDerivation rec {
nativeBuildInputs = [ makeWrapper pkgconfig ]; nativeBuildInputs = [ makeWrapper pkgconfig ];
buildInputs = [ buildInputs = [
libxml2 gnutls perl python2 readline libxml2 gnutls perl python2 readline
gettext libtasn1 libgcrypt yajl gettext libtasn1 libgcrypt yajl attr
libxslt xhtml1 perlPackages.XMLXPath curl libpcap libxslt xhtml1 perlPackages.XMLXPath curl libpcap
] ++ stdenv.lib.optionals stdenv.isLinux [ ] ++ optionals stdenv.isLinux [
libpciaccess devicemapper lvm2 utillinux systemd libcap_ng libpciaccess devicemapper lvm2 utillinux systemd libcap_ng
libnl numad numactl xen zfs libnl numad numactl xen zfs libapparmor
] ++ stdenv.lib.optionals stdenv.isDarwin [ ] ++ optionals stdenv.isDarwin [
libiconv gmp libiconv gmp
]; ];
preConfigure = stdenv.lib.optionalString stdenv.isLinux '' preConfigure = optionalString stdenv.isLinux ''
PATH=${stdenv.lib.makeBinPath [ iproute iptables ebtables lvm2 systemd ]}:$PATH PATH=${stdenv.lib.makeBinPath [ iproute iptables ebtables lvm2 systemd ]}:$PATH
substituteInPlace configure \ substituteInPlace configure \
--replace 'as_dummy="/bin:/usr/bin:/usr/sbin"' 'as_dummy="${numad}/bin"' --replace 'as_dummy="/bin:/usr/bin:/usr/sbin"' 'as_dummy="${numad}/bin"'
@ -48,13 +51,16 @@ stdenv.mkDerivation rec {
"--with-test" "--with-test"
"--with-esx" "--with-esx"
"--with-remote" "--with-remote"
] ++ stdenv.lib.optionals stdenv.isLinux [ ] ++ optionals stdenv.isLinux [
"--with-attr"
"--with-apparmor"
"--with-secdriver-apparmor"
"--with-numad" "--with-numad"
"--with-macvtap" "--with-macvtap"
"--with-virtualport" "--with-virtualport"
"--with-init-script=redhat" "--with-init-script=systemd+redhat"
"--with-storage-zfs" "--with-storage-zfs"
] ++ stdenv.lib.optionals stdenv.isDarwin [ ] ++ optionals stdenv.isDarwin [
"--with-init-script=none" "--with-init-script=none"
]; ];
@ -66,17 +72,19 @@ stdenv.mkDerivation rec {
postInstall = '' postInstall = ''
sed -i 's/ON_SHUTDOWN=suspend/ON_SHUTDOWN=''${ON_SHUTDOWN:-suspend}/' $out/libexec/libvirt-guests.sh sed -i 's/ON_SHUTDOWN=suspend/ON_SHUTDOWN=''${ON_SHUTDOWN:-suspend}/' $out/libexec/libvirt-guests.sh
substituteInPlace $out/libexec/libvirt-guests.sh \ substituteInPlace $out/libexec/libvirt-guests.sh \
--replace "$out/bin" "${gettext}/bin" --replace "$out/bin" "${gettext}/bin" \
'' + stdenv.lib.optionalString stdenv.isLinux '' --replace "lock/subsys" "lock"
rm $out/lib/systemd/system/{virtlockd,virtlogd}.*
'' + optionalString stdenv.isLinux ''
wrapProgram $out/sbin/libvirtd \ wrapProgram $out/sbin/libvirtd \
--prefix PATH : ${stdenv.lib.makeBinPath [ iptables iproute pmutils numad numactl ]} --prefix PATH : ${makeBinPath [ iptables iproute pmutils numad numactl ]}
''; '';
enableParallelBuilding = true; enableParallelBuilding = true;
NIX_CFLAGS_COMPILE = "-fno-stack-protector"; NIX_CFLAGS_COMPILE = "-fno-stack-protector";
meta = with stdenv.lib; { meta = {
homepage = http://libvirt.org/; homepage = http://libvirt.org/;
repositories.git = git://libvirt.org/libvirt.git; repositories.git = git://libvirt.org/libvirt.git;
description = '' description = ''

View file

@ -29039,13 +29039,13 @@ EOF
}; };
libvirt = let libvirt = let
version = "3.0.0"; version = "3.1.0";
in assert version == pkgs.libvirt.version; pkgs.stdenv.mkDerivation rec { in assert version == pkgs.libvirt.version; pkgs.stdenv.mkDerivation rec {
name = "libvirt-python-${version}"; name = "libvirt-python-${version}";
src = pkgs.fetchurl { src = pkgs.fetchurl {
url = "http://libvirt.org/sources/python/${name}.tar.gz"; url = "http://libvirt.org/sources/python/${name}.tar.gz";
sha256 = "1ha4bqf029si1lla1z7ca786w571fh3wfs4h7zaglfk4gb2w39wl"; sha256 = "06524dhm27fjfnmr5bqdxlmm1g9ixvzaaq572hgyy5dqwfn64spk";
}; };
buildInputs = with self; [ python pkgs.pkgconfig pkgs.libvirt lxml ]; buildInputs = with self; [ python pkgs.pkgconfig pkgs.libvirt lxml ];