news: Update for SMMUv3 IOMMU support
[libvirt/ericb.git] / m4 / virt-storage-zfs.m4
blob0c52264dbe8edc50aec68b6466f81041ea348f8e
1 dnl The storage ZFS check
2 dnl
3 dnl Copyright (C) 2016 Red Hat, Inc.
4 dnl
5 dnl This library is free software; you can redistribute it and/or
6 dnl modify it under the terms of the GNU Lesser General Public
7 dnl License as published by the Free Software Foundation; either
8 dnl version 2.1 of the License, or (at your option) any later version.
9 dnl
10 dnl This library is distributed in the hope that it will be useful,
11 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
12 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13 dnl Lesser General Public License for more details.
14 dnl
15 dnl You should have received a copy of the GNU Lesser General Public
16 dnl License along with this library.  If not, see
17 dnl <http://www.gnu.org/licenses/>.
18 dnl
20 AC_DEFUN([LIBVIRT_STORAGE_ARG_ZFS], [
21   LIBVIRT_ARG_WITH_FEATURE([STORAGE_ZFS], [ZFS backend for the storage driver], [check])
24 AC_DEFUN([LIBVIRT_STORAGE_CHECK_ZFS], [
25   if test "$with_storage_zfs" = "yes" ||
26      test "$with_storage_zfs" = "check"; then
27     AC_PATH_PROG([ZFS], [zfs], [], [$LIBVIRT_SBIN_PATH])
28     AC_PATH_PROG([ZPOOL], [zpool], [], [$LIBVIRT_SBIN_PATH])
30     if test "$with_storage_zfs" = "yes"; then
31       if test -z "$ZFS" || test -z "$ZPOOL"; then
32         AC_MSG_ERROR([We need zfs and zpool for ZFS storage driver])
33       fi
34     else
35       if test -z "$ZFS" || test -z "$ZPOOL"; then
36         with_storage_zfs=no
37       fi
39       if test "$with_storage_zfs" = "check"; then
40         with_storage_zfs=yes
41       fi
42     fi
44     if test "$with_storage_zfs" = "yes"; then
45       AC_DEFINE_UNQUOTED([WITH_STORAGE_ZFS], 1,
46         [whether ZFS backend for storage driver is enabled])
47       AC_DEFINE_UNQUOTED([ZFS], ["$ZFS"], [Location of zfs program])
48       AC_DEFINE_UNQUOTED([ZPOOL], ["$ZPOOL"], [Location of zpool program])
49     fi
50   fi
51   AM_CONDITIONAL([WITH_STORAGE_ZFS], [test "$with_storage_zfs" = "yes"])
54 AC_DEFUN([LIBVIRT_STORAGE_RESULT_ZFS], [
55   LIBVIRT_RESULT([ZFS], [$with_storage_zfs])