1 dnl The storage ZFS check
3 dnl Copyright (C) 2016 Red Hat, Inc.
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.
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.
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/>.
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])
35 if test -z "$ZFS" || test -z "$ZPOOL"; then
39 if test "$with_storage_zfs" = "check"; then
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])
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])