libvirt: enable (optional) support for iscsi storage (#42545)

This commit is contained in:
ajs124 2018-06-25 13:11:56 +02:00 committed by xeji
parent e0208b9d3a
commit 2cd0c2e2df

View File

@ -6,6 +6,7 @@
, dnsmasq, libnl, libpcap, libxslt, xhtml1, numad, numactl, perlPackages
, curl, libiconv, gmp, zfs, parted, bridge-utils, dmidecode
, enableXen ? false, xen ? null
, enableIscsi ? false, openiscsi
}:
with stdenv.lib;
@ -42,6 +43,8 @@ in stdenv.mkDerivation rec {
libapparmor libcap_ng numactl attr parted
] ++ optionals (enableXen && stdenv.isLinux && stdenv.isx86_64) [
xen
] ++ optionals enableIscsi [
openiscsi
] ++ optionals stdenv.isDarwin [
libiconv gmp
];
@ -49,7 +52,7 @@ in stdenv.mkDerivation rec {
preConfigure = ''
${ optionalString (!buildFromTarball) "./bootstrap --no-git --gnulib-srcdir=$(pwd)/.gnulib" }
PATH=${stdenv.lib.makeBinPath ([ dnsmasq ] ++ optionals stdenv.isLinux [ iproute iptables ebtables lvm2 systemd numad ])}:$PATH
PATH=${stdenv.lib.makeBinPath ([ dnsmasq ] ++ optionals stdenv.isLinux [ iproute iptables ebtables lvm2 systemd numad ] ++ optionals enableIscsi [ openiscsi ])}:$PATH
# the path to qemu-kvm will be stored in VM's .xml and .save files
# do not use "''${qemu_kvm}/bin/qemu-kvm" to avoid bound VMs to particular qemu derivations
@ -79,6 +82,8 @@ in stdenv.mkDerivation rec {
"--with-storage-disk"
] ++ optionals (stdenv.isLinux && zfs != null) [
"--with-storage-zfs"
] ++ optionals enableIscsi [
"--with-storage-iscsi"
] ++ optionals stdenv.isDarwin [
"--with-init-script=none"
];