From: Neal Gompa Date: Mon, 17 Jul 2017 11:32:46 -0400 Subject: [PATCH] spec: Add support for building the zfs storage driver Where it can be supported in Fedora, the driver is built and made available as a subpackage. Signed-off-by: Neal Gompa (cherry picked from commit 9af764e86aef7dfb0191a9561bf1d1abf941da05) --- libvirt.spec.in | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/libvirt.spec.in b/libvirt.spec.in index 8eb67fa2e..f9a705e7c 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -70,6 +70,13 @@ %define with_storage_gluster 0%{!?_without_storage_gluster:1} %define with_numactl 0%{!?_without_numactl:1} +# F25+ has zfs-fuse +%if 0%{?fedora} >= 25 + %define with_storage_zfs 0%{!?_without_storage_zfs:1} +%else + %define with_storage_zfs 0 +%endif + # A few optional bits off by default, we enable later %define with_fuse 0%{!?_without_fuse:0} %define with_cgconfig 0%{!?_without_cgconfig:0} @@ -113,6 +120,12 @@ %endif %endif +# zfs-fuse is not available on some architectures +%ifarch s390 s390x aarch64 + %define with_storage_zfs 0 +%endif + + # RHEL doesn't ship OpenVZ, VBox, UML, PowerHypervisor, # VMware, libxenserver (xenapi), libxenlight (Xen 4.1 and newer), # or HyperV. @@ -364,6 +377,12 @@ BuildRequires: glusterfs-devel >= 3.4.1 %if %{with_storage_sheepdog} BuildRequires: sheepdog %endif +%if %{with_storage_zfs} +# Support any conforming implementation of zfs. On stock Fedora +# this is zfs-fuse, but could be zfsonlinux upstream RPMs +BuildRequires: /sbin/zfs +BuildRequires: /sbin/zpool +%endif %if %{with_numactl} # For QEMU/LXC numa info BuildRequires: numactl-devel @@ -597,6 +616,11 @@ Requires: device-mapper # For Sheepdog support Requires: sheepdog %endif +%if %{with_storage_zfs} +# Support any conforming implementation of zfs +Requires: /sbin/zfs +Requires: /sbin/zpool +%endif %if %{with_qemu} # From QEMU RPMs Requires: /usr/bin/qemu-img @@ -1063,6 +1087,12 @@ rm -rf .git %define arg_storage_gluster --without-storage-gluster %endif +%if %{with_storage_zfs} + %define arg_storage_zfs --with-storage-zfs +%else + %define arg_storage_zfs --without-storage-zfs +%endif + %if %{with_numactl} %define arg_numactl --with-numactl %else @@ -1170,6 +1200,7 @@ rm -f po/stamp-po %{?arg_storage_rbd} \ %{?arg_storage_sheepdog} \ %{?arg_storage_gluster} \ + %{?arg_storage_zfs} \ %{?arg_numactl} \ %{?arg_numad} \ --with-capng \