From nobody Sun Feb 8 22:35:28 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-delivery-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=1594893882; cv=none; d=zohomail.com; s=zohoarc; b=cJLNT9jdCWI7LXNISWSqy/HQCYV5XEUZr5lSOXnIuollGKLRYpaVYpeP/ftENUwdKw6yM8LyL85PqcHWucUHs5r2ORUswy6hRjmEID/6Y7tjBCgoQTVmbArrICNbcYPkr9Y1obHfoNwK7mHO/qPwCj4TLx+vcs0fMRjIbEUm42U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1594893882; 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=2Xd0p9VjFosMBX9x8hm+MVZA+dBITbBnq0waVqQe0zA=; b=e//gDeSrRe5N19XgIzQv/J98WqJpGNWPgiVAIu2LvwIBXHqzygrNudCTksIejgfkTodOIESd8VrQH12L2TtHAfBIHqACX+pbFbrK81k7aJNFTu6gI8scob4B+J7jLdhIgR/TCT1pSDmBZmwXuBTTvSafb+kANjWDRsCf9CR6hJA= 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-delivery-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 1594893882656657.238482143961; Thu, 16 Jul 2020 03:04:42 -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-361-J833VcHfM4GVQSValznIug-1; Thu, 16 Jul 2020 06:03:24 -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 31F2A100D0E3; Thu, 16 Jul 2020 10:03:11 +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 08FBD79D1F; Thu, 16 Jul 2020 10:03:11 +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 C3F58180530D; Thu, 16 Jul 2020 10:03:10 +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 06GA35hf016936 for ; Thu, 16 Jul 2020 06:03:05 -0400 Received: by smtp.corp.redhat.com (Postfix) id 7D01D2DE72; Thu, 16 Jul 2020 10:03:05 +0000 (UTC) Received: from antique-work.redhat.com (unknown [10.40.194.85]) by smtp.corp.redhat.com (Postfix) with ESMTP id EB16F2DE71 for ; Thu, 16 Jul 2020 10:03:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1594893881; 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=2Xd0p9VjFosMBX9x8hm+MVZA+dBITbBnq0waVqQe0zA=; b=Bdeu/dhTAT2rcoqsM1w296eznHO+6JZo3+Y1gXBQWh/+pajWEIlcjwNavTNdaZtpHhqjXq sZogFSrg00GR7zM2rrjjftgmcWOycHAAMY6E4boR0PPjlI6tf6MFjMavYTzk4ivg0bFPb+ znXt12WwifEvXFAHpmv1WN7F/Pd08Rg= X-MC-Unique: J833VcHfM4GVQSValznIug-1 From: Pavel Hrdina To: libvir-list@redhat.com Subject: [libvirt PATCH 105/351] meson: add storage lvm build options Date: Thu, 16 Jul 2020 11:55:41 +0200 Message-Id: <11626dd5a7057d06a253892a33ad1db207b9b104.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 | 4 -- m4/virt-storage-lvm.m4 | 90 ------------------------------------------ meson.build | 29 ++++++++++++++ meson_options.txt | 1 + 4 files changed, 30 insertions(+), 94 deletions(-) delete mode 100644 m4/virt-storage-lvm.m4 diff --git a/configure.ac b/configure.ac index 688425956e1..acfad8737ee 100644 --- a/configure.ac +++ b/configure.ac @@ -136,7 +136,6 @@ dnl dnl Storage driver checks dnl =20 -LIBVIRT_STORAGE_ARG_LVM LIBVIRT_STORAGE_ARG_SCSI LIBVIRT_STORAGE_ARG_MPATH LIBVIRT_STORAGE_ARG_RBD @@ -145,7 +144,6 @@ LIBVIRT_STORAGE_ARG_ZFS LIBVIRT_STORAGE_ARG_VSTORAGE =20 if test "$with_libvirtd" =3D "no"; then - with_storage_lvm=3Dno with_storage_scsi=3Dno with_storage_mpath=3Dno with_storage_rbd=3Dno @@ -154,7 +152,6 @@ if test "$with_libvirtd" =3D "no"; then with_storage_vstorage=3Dno fi =20 -LIBVIRT_STORAGE_CHECK_LVM LIBVIRT_STORAGE_CHECK_SCSI LIBVIRT_STORAGE_CHECK_MPATH LIBVIRT_STORAGE_CHECK_RBD @@ -218,7 +215,6 @@ 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_LVM LIBVIRT_STORAGE_RESULT_SCSI LIBVIRT_STORAGE_RESULT_MPATH LIBVIRT_STORAGE_RESULT_RBD diff --git a/m4/virt-storage-lvm.m4 b/m4/virt-storage-lvm.m4 deleted file mode 100644 index a0ccca7a00a..00000000000 --- a/m4/virt-storage-lvm.m4 +++ /dev/null @@ -1,90 +0,0 @@ -dnl The storage LVM 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_LVM], [ - LIBVIRT_ARG_WITH_FEATURE([STORAGE_LVM], [LVM backend for storage driver]= , [check]) -]) - -AC_DEFUN([LIBVIRT_STORAGE_CHECK_LVM], [ - if test "$with_storage_lvm" =3D "yes" || test "$with_storage_lvm" =3D "c= heck"; then - AC_PATH_PROG([PVCREATE], [pvcreate], [], [$LIBVIRT_SBIN_PATH]) - AC_PATH_PROG([VGCREATE], [vgcreate], [], [$LIBVIRT_SBIN_PATH]) - AC_PATH_PROG([LVCREATE], [lvcreate], [], [$LIBVIRT_SBIN_PATH]) - AC_PATH_PROG([PVREMOVE], [pvremove], [], [$LIBVIRT_SBIN_PATH]) - AC_PATH_PROG([VGREMOVE], [vgremove], [], [$LIBVIRT_SBIN_PATH]) - AC_PATH_PROG([LVREMOVE], [lvremove], [], [$LIBVIRT_SBIN_PATH]) - AC_PATH_PROG([LVCHANGE], [lvchange], [], [$LIBVIRT_SBIN_PATH]) - AC_PATH_PROG([VGCHANGE], [vgchange], [], [$LIBVIRT_SBIN_PATH]) - AC_PATH_PROG([VGSCAN], [vgscan], [], [$LIBVIRT_SBIN_PATH]) - AC_PATH_PROG([PVS], [pvs], [], [$LIBVIRT_SBIN_PATH]) - AC_PATH_PROG([VGS], [vgs], [], [$LIBVIRT_SBIN_PATH]) - AC_PATH_PROG([LVS], [lvs], [], [$LIBVIRT_SBIN_PATH]) - - if test "$with_storage_lvm" =3D "yes" ; then - if test -z "$PVCREATE" ; then AC_MSG_ERROR([We need pvcreate for LVM= storage driver]) ; fi - if test -z "$VGCREATE" ; then AC_MSG_ERROR([We need vgcreate for LVM= storage driver]) ; fi - if test -z "$LVCREATE" ; then AC_MSG_ERROR([We need lvcreate for LVM= storage driver]) ; fi - if test -z "$PVREMOVE" ; then AC_MSG_ERROR([We need pvremove for LVM= storage driver]) ; fi - if test -z "$VGREMOVE" ; then AC_MSG_ERROR([We need vgremove for LVM= storage driver]) ; fi - if test -z "$LVREMOVE" ; then AC_MSG_ERROR([We need lvremove for LVM= storage driver]) ; fi - if test -z "$LVCHANGE" ; then AC_MSG_ERROR([We need lvchange for LVM= storage driver]) ; fi - if test -z "$VGCHANGE" ; then AC_MSG_ERROR([We need vgchange for LVM= storage driver]) ; fi - if test -z "$VGSCAN" ; then AC_MSG_ERROR([We need vgscan for LVM sto= rage driver]) ; fi - if test -z "$PVS" ; then AC_MSG_ERROR([We need pvs for LVM storage d= river]) ; fi - if test -z "$VGS" ; then AC_MSG_ERROR([We need vgs for LVM storage d= river]) ; fi - if test -z "$LVS" ; then AC_MSG_ERROR([We need lvs for LVM storage d= river]) ; fi - else - if test -z "$PVCREATE" ; then with_storage_lvm=3Dno ; fi - if test -z "$VGCREATE" ; then with_storage_lvm=3Dno ; fi - if test -z "$LVCREATE" ; then with_storage_lvm=3Dno ; fi - if test -z "$PVREMOVE" ; then with_storage_lvm=3Dno ; fi - if test -z "$VGREMOVE" ; then with_storage_lvm=3Dno ; fi - if test -z "$LVREMOVE" ; then with_storage_lvm=3Dno ; fi - if test -z "$LVCHANGE" ; then with_storage_lvm=3Dno ; fi - if test -z "$VGCHANGE" ; then with_storage_lvm=3Dno ; fi - if test -z "$VGSCAN" ; then with_storage_lvm=3Dno ; fi - if test -z "$PVS" ; then with_storage_lvm=3Dno ; fi - if test -z "$VGS" ; then with_storage_lvm=3Dno ; fi - if test -z "$LVS" ; then with_storage_lvm=3Dno ; fi - - if test "$with_storage_lvm" =3D "check" ; then with_storage_lvm=3Dye= s ; fi - fi - - if test "$with_storage_lvm" =3D "yes" ; then - AC_DEFINE_UNQUOTED([WITH_STORAGE_LVM], 1, [whether LVM backend for s= torage driver is enabled]) - AC_DEFINE_UNQUOTED([PVCREATE],["$PVCREATE"],[Location of pvcreate pr= ogram]) - AC_DEFINE_UNQUOTED([VGCREATE],["$VGCREATE"],[Location of vgcreate pr= ogram]) - AC_DEFINE_UNQUOTED([LVCREATE],["$LVCREATE"],[Location of lvcreate pr= ogram]) - AC_DEFINE_UNQUOTED([PVREMOVE],["$PVREMOVE"],[Location of pvremove pr= ogram]) - AC_DEFINE_UNQUOTED([VGREMOVE],["$VGREMOVE"],[Location of vgremove pr= ogram]) - AC_DEFINE_UNQUOTED([LVREMOVE],["$LVREMOVE"],[Location of lvremove pr= ogram]) - AC_DEFINE_UNQUOTED([LVCHANGE],["$LVCHANGE"],[Location of lvchange pr= ogram]) - AC_DEFINE_UNQUOTED([VGCHANGE],["$VGCHANGE"],[Location of vgchange pr= ogram]) - AC_DEFINE_UNQUOTED([VGSCAN],["$VGSCAN"],[Location of vgscan program]) - AC_DEFINE_UNQUOTED([PVS],["$PVS"],[Location of pvs program]) - AC_DEFINE_UNQUOTED([VGS],["$VGS"],[Location of vgs program]) - AC_DEFINE_UNQUOTED([LVS],["$LVS"],[Location of lvs program]) - fi - fi - AM_CONDITIONAL([WITH_STORAGE_LVM], [test "$with_storage_lvm" =3D "yes"]) -]) - -AC_DEFUN([LIBVIRT_STORAGE_RESULT_LVM], [ - LIBVIRT_RESULT([LVM], [$with_storage_lvm]) -]) diff --git a/meson.build b/meson.build index 4576f18a6e2..cecc161ed85 100644 --- a/meson.build +++ b/meson.build @@ -1941,6 +1941,34 @@ if conf.has('WITH_LIBVIRTD') elif get_option('storage_iscsi_direct').enabled() error('Need libiscsi for iscsi-direct storage driver') endif + + if not get_option('storage_lvm').disabled() + lvm_enable =3D true + lvm_progs =3D [ + 'pvcreate', 'vgcreate', 'lvcreate', + 'pvremove', 'vgremove', 'lvremove', + 'lvchange', 'vgchange', 'vgscan', + 'pvs', 'vgs', 'lvs', + ] + foreach name : lvm_progs + set_variable( + '@0@_prog'.format(name), + find_program(name, required: get_option('storage_lvm'), dirs: libv= irt_sbin_path) + ) + if not get_variable('@0@_prog'.format(name)).found() + lvm_enable =3D false + endif + endforeach + + if lvm_enable + use_storage =3D true + conf.set('WITH_STORAGE_LVM', 1) + + foreach name : lvm_progs + conf.set_quoted(name.to_upper(), get_variable('@0@_prog'.format(na= me)).path()) + endforeach + endif + endif endif =20 if use_storage @@ -1989,6 +2017,7 @@ storagedriver_summary =3D { 'Dir': conf.has('WITH_STORAGE_DIR'), 'FS': conf.has('WITH_STORAGE_FS'), 'NetFS': conf.has('WITH_STORAGE_FS'), + 'LVM': conf.has('WITH_STORAGE_LVM'), 'iSCSI': conf.has('WITH_STORAGE_ISCSI'), 'iscsi-direct': conf.has('WITH_STORAGE_ISCSI_DIRECT'), 'Disk': conf.has('WITH_STORAGE_DISK'), diff --git a/meson_options.txt b/meson_options.txt index 975479e7b8c..66e232f59dc 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -80,3 +80,4 @@ option('storage_fs', type: 'feature', value: 'auto', desc= ription: 'FileSystem ba option('storage_gluster', type: 'feature', value: 'auto', description: 'Gl= uster backend for the storage driver') option('storage_iscsi', type: 'feature', value: 'auto', description: 'iscs= i backend for the storage driver') option('storage_iscsi_direct', type: 'feature', value: 'auto', description= : 'iscsi-direct backend for the storage driver') +option('storage_lvm', type: 'feature', value: 'auto', description: 'LVM ba= ckend for the storage driver') --=20 2.26.2