From nobody Sun Feb 8 09:22:25 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1594894084; cv=none; d=zohomail.com; s=zohoarc; b=H6aWKuo5dF5A05EReqzTwfyIRxF2q1wmz/oWvW1w6WHGq5pnM+a1JAyxxlvb07P8S5zSSf4+pdLIpfqXGGYtnAD+FMJNu+5q8tW+xAR8NuLgvrjGmT7rdeb5CXITR9eU11fNFmLQVLNprJDUFEDX3MqS9HBlSf9VDSpxJDzYzoY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1594894084; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=DpP0mvtIUdFIRF1tgdtHrykjWBkzj2+s3KRVuTtyExQ=; b=jVmq2MGUxMFVmqAYDo81BMzgpfUD1TXot2S88zrNEIEkikhcgn/tU1d7ed4XZDzgenqMenhg7mY42V8lDmWTT8tZLpxYL5Wc3C3nPTdq0lPYdPbih6lUpX/JV5ACVWTWZU2nZJVcIKKXRnhPVFHsnREa2oK4HGPAf2c/KFp+knY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 1594894084033210.96905824262865; Thu, 16 Jul 2020 03:08:04 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-166-w31Pr6lWMFCWSuz_MKLXvQ-1; Thu, 16 Jul 2020 06:03:27 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id ECA351888AB5; Thu, 16 Jul 2020 10:03:13 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id CD61D74F64; Thu, 16 Jul 2020 10:03:13 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 9BAB41805316; Thu, 16 Jul 2020 10:03:13 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 06GA3AeS017014 for ; Thu, 16 Jul 2020 06:03:10 -0400 Received: by smtp.corp.redhat.com (Postfix) id E702F2E025; Thu, 16 Jul 2020 10:03:10 +0000 (UTC) Received: from antique-work.redhat.com (unknown [10.40.194.85]) by smtp.corp.redhat.com (Postfix) with ESMTP id 603EC2DE9E for ; Thu, 16 Jul 2020 10:03:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1594894082; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=DpP0mvtIUdFIRF1tgdtHrykjWBkzj2+s3KRVuTtyExQ=; b=GlYj9ssXXyOyT7wqH/H0MHiWhXIz04NG2v8Sf2I4NPxmwq1CszoCwJAct3rGQLY4XtcoVq VVo+stKNzwzvBnz3RfCMDWxrcpq/9Fa0XpLDfWgt3K2q5F75Z06r9PwNe/3760PGiWUIzk ni/84nkrTzUYwnc4XPv8VSrALW68BT0= X-MC-Unique: w31Pr6lWMFCWSuz_MKLXvQ-1 From: Pavel Hrdina To: libvir-list@redhat.com Subject: [libvirt PATCH 111/351] meson: add storage ZFS build option Date: Thu, 16 Jul 2020 11:55:47 +0200 Message-Id: <21c49ef8f9e89204c9ff4299a7b95ec33a0b70da.1594891445.git.phrdina@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Signed-off-by: Pavel Hrdina --- configure.ac | 16 ------------ m4/virt-storage-zfs.m4 | 56 ------------------------------------------ meson.build | 22 +++++++++++++++++ meson_options.txt | 1 + 4 files changed, 23 insertions(+), 72 deletions(-) delete mode 100644 m4/virt-storage-zfs.m4 diff --git a/configure.ac b/configure.ac index 6416986c303..030313b7ed5 100644 --- a/configure.ac +++ b/configure.ac @@ -130,18 +130,6 @@ dnl Need to test if pkg-config exists PKG_PROG_PKG_CONFIG =20 =20 -dnl -dnl Storage driver checks -dnl - -LIBVIRT_STORAGE_ARG_ZFS - -if test "$with_libvirtd" =3D "no"; then - with_storage_zfs=3Dno -fi - -LIBVIRT_STORAGE_CHECK_ZFS - dnl Python3 < 3.7 treats the C locale as 7-bit only. dnl We must force env vars so it treats it as UTF-8 dnl regardless of the user's locale. @@ -196,10 +184,6 @@ AC_MSG_NOTICE([]) AC_MSG_NOTICE([Configuration summary]) AC_MSG_NOTICE([=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D]) AC_MSG_NOTICE([]) -AC_MSG_NOTICE([Storage Drivers]) -AC_MSG_NOTICE([]) -LIBVIRT_STORAGE_RESULT_ZFS -AC_MSG_NOTICE([]) AC_MSG_NOTICE([Driver Loadable Modules]) AC_MSG_NOTICE([]) LIBVIRT_RESULT_DRIVER_MODULES diff --git a/m4/virt-storage-zfs.m4 b/m4/virt-storage-zfs.m4 deleted file mode 100644 index 0c52264dbe8..00000000000 --- a/m4/virt-storage-zfs.m4 +++ /dev/null @@ -1,56 +0,0 @@ -dnl The storage ZFS check -dnl -dnl Copyright (C) 2016 Red Hat, Inc. -dnl -dnl This library is free software; you can redistribute it and/or -dnl modify it under the terms of the GNU Lesser General Public -dnl License as published by the Free Software Foundation; either -dnl version 2.1 of the License, or (at your option) any later version. -dnl -dnl This library is distributed in the hope that it will be useful, -dnl but WITHOUT ANY WARRANTY; without even the implied warranty of -dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -dnl Lesser General Public License for more details. -dnl -dnl You should have received a copy of the GNU Lesser General Public -dnl License along with this library. If not, see -dnl . -dnl - -AC_DEFUN([LIBVIRT_STORAGE_ARG_ZFS], [ - LIBVIRT_ARG_WITH_FEATURE([STORAGE_ZFS], [ZFS backend for the storage dri= ver], [check]) -]) - -AC_DEFUN([LIBVIRT_STORAGE_CHECK_ZFS], [ - if test "$with_storage_zfs" =3D "yes" || - test "$with_storage_zfs" =3D "check"; then - AC_PATH_PROG([ZFS], [zfs], [], [$LIBVIRT_SBIN_PATH]) - AC_PATH_PROG([ZPOOL], [zpool], [], [$LIBVIRT_SBIN_PATH]) - - if test "$with_storage_zfs" =3D "yes"; then - if test -z "$ZFS" || test -z "$ZPOOL"; then - AC_MSG_ERROR([We need zfs and zpool for ZFS storage driver]) - fi - else - if test -z "$ZFS" || test -z "$ZPOOL"; then - with_storage_zfs=3Dno - fi - - if test "$with_storage_zfs" =3D "check"; then - with_storage_zfs=3Dyes - fi - fi - - if test "$with_storage_zfs" =3D "yes"; then - AC_DEFINE_UNQUOTED([WITH_STORAGE_ZFS], 1, - [whether ZFS backend for storage driver is enabled]) - AC_DEFINE_UNQUOTED([ZFS], ["$ZFS"], [Location of zfs program]) - AC_DEFINE_UNQUOTED([ZPOOL], ["$ZPOOL"], [Location of zpool program]) - fi - fi - AM_CONDITIONAL([WITH_STORAGE_ZFS], [test "$with_storage_zfs" =3D "yes"]) -]) - -AC_DEFUN([LIBVIRT_STORAGE_RESULT_ZFS], [ - LIBVIRT_RESULT([ZFS], [$with_storage_zfs]) -]) diff --git a/meson.build b/meson.build index 83f7710f93c..64583b3662a 100644 --- a/meson.build +++ b/meson.build @@ -2021,6 +2021,27 @@ if conf.has('WITH_LIBVIRTD') endforeach endif endif + + if not get_option('storage_zfs').disabled() + zfs_enable =3D true + foreach name : ['zfs', 'zpool'] + set_variable( + '@0@_prog'.format(name), + find_program(name, required: get_option('storage_zfs'), dirs: libv= irt_sbin_path) + ) + if not get_variable('@0@_prog'.format(name)).found() + zfs_enable =3D false + endif + endforeach + + if zfs_enable + use_storage =3D true + conf.set('WITH_STORAGE_ZFS', 1) + foreach name : ['zfs', 'zpool'] + conf.set_quoted(name.to_upper(), get_variable('@0@_prog'.format(na= me)).path()) + endforeach + endif + endif endif =20 if use_storage @@ -2078,6 +2099,7 @@ storagedriver_summary =3D { 'RBD': conf.has('WITH_STORAGE_RBD'), 'Sheepdog': conf.has('WITH_STORAGE_SHEEPDOG'), 'Gluster': conf.has('WITH_STORAGE_GLUSTER'), + 'ZFS': conf.has('WITH_STORAGE_ZFS'), 'Virtuozzo storage': conf.has('WITH_STORAGE_VSTORAGE'), } summary(storagedriver_summary, section: 'Storage Drivers', bool_yn: true) diff --git a/meson_options.txt b/meson_options.txt index 4d8cac9254a..d68712ae2be 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -86,3 +86,4 @@ option('storage_rbd', type: 'feature', value: 'auto', des= cription: 'RADOS Block option('storage_scsi', type: 'feature', value: 'auto', description: 'SCSI = backend for the storage driver') option('storage_sheepdog', type: 'feature', value: 'auto', description: 'S= heepdog backend for the storage driver') option('storage_vstorage', type: 'feature', value: 'auto', description: 'V= irtuozzo storage backend for the storage driver') +option('storage_zfs', type: 'feature', value: 'auto', description: 'ZFS ba= ckend for the storage driver') --=20 2.26.2