From nobody Fri May 17 23:38:13 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 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=1621929661; cv=none; d=zohomail.com; s=zohoarc; b=DDApGSxfp4utzB9YzzU2ksahNCwMWhJC0TNQ0oT5QooZmZFFK4aNFBhqtEUBN4gxpeXJ9GgA0P81JmbDfMP2RjgtOzQK345SMpjx/1pNlRLRWgpLggvtChdU1sRGhURntOx2W4gy7dXtneysm7TFlGzW/cU0JTbYbf8ceV8Gj28= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1621929661; 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=jOSf9j8CUCmmFcMpM903undIVhgHEbRsrbtBYasJwM0=; b=cTz1NlpHqbU4OP/mOMjVyCljZxfJyWoXdUZeZZKl8SVdNtDdclCT9YcneoMaFhJULjzMnn8Ipmq7jXAeHVH1HiFFII7S+xoJVC9lIup36G77YKq06XHFhLNFr5nNPpxcQ2E9fkb+sSyNl7J/NUVD8b2XLATVFAPcMwMymhBSGlE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 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-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1621929661198165.9651899476006; Tue, 25 May 2021 01:01:01 -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-506-tiioOgmnN7mUkSPXvazTXg-1; Tue, 25 May 2021 04:00:57 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 040A019251AA; Tue, 25 May 2021 08:00:53 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D241E5D9D7; Tue, 25 May 2021 08:00:52 +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 2A7C855342; Tue, 25 May 2021 08:00:52 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 14P80nkm021805 for ; Tue, 25 May 2021 04:00:49 -0400 Received: by smtp.corp.redhat.com (Postfix) id 5068119CBC; Tue, 25 May 2021 08:00:49 +0000 (UTC) Received: from antique-work.redhat.com (unknown [10.40.193.112]) by smtp.corp.redhat.com (Postfix) with ESMTP id C4BC418AD4 for ; Tue, 25 May 2021 08:00:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1621929660; 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=jOSf9j8CUCmmFcMpM903undIVhgHEbRsrbtBYasJwM0=; b=ERYP7HXLqkvPIuJnD+U/TdBG8YQxwuYpwr/HYWEFve7usF0kU3qE/U4VqGgD/EAn/gdisQ 3cBxogCyRxKRMkvtXvx6KGFE112z8+YDHSU0rSlHANYytuCs8Z9vsBF4F/RyrzgcmSU2kB NISxfELijd94hyDz+VX6cWbEJFU3vok= X-MC-Unique: tiioOgmnN7mUkSPXvazTXg-1 From: Pavel Hrdina To: libvir-list@redhat.com Subject: [PATCH RESEND v3 1/8] virfile: introduce virFindFileInPathFull() Date: Tue, 25 May 2021 10:00:40 +0200 Message-Id: <9a51adf42b41982b61e730253a212d088b1c096e.1621929489.git.phrdina@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 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.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com 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" Extend virFindFileInPath to search in custom extra paths as well. Some binaries that libvirt needs are not usually in $PATH so we need to have a way to look for these as well. Signed-off-by: Pavel Hrdina Reviewed-by: Andrea Bolognani --- src/libvirt_private.syms | 2 +- src/util/virfile.c | 16 ++++++++++++++-- src/util/virfile.h | 5 ++++- tests/testutilsqemu.c | 3 ++- tests/virfirewallmock.c | 3 ++- 5 files changed, 23 insertions(+), 6 deletions(-) diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index e1aef5267e..2ab43d5ffb 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -2259,7 +2259,7 @@ virFileWrapperFdClose; virFileWrapperFdFree; virFileWrapperFdNew; virFileWriteStr; -virFindFileInPath; +virFindFileInPathFull; =20 =20 # util/virfilecache.h diff --git a/src/util/virfile.c b/src/util/virfile.c index 03a7725dd3..7922fda2e5 100644 --- a/src/util/virfile.c +++ b/src/util/virfile.c @@ -1654,13 +1654,15 @@ virFileIsLink(const char *linkpath) } =20 /* - * Finds a requested executable file in the PATH env. e.g.: + * Finds a requested executable file in the paths provided by @extra_paths + * argument or in PATH env. e.g.: * "qemu-img" will return "/usr/bin/qemu-img" * * You must free the result */ char * -virFindFileInPath(const char *file) +virFindFileInPathFull(const char *file, + const GStrv extra_paths) { const char *origpath =3D NULL; g_auto(GStrv) paths =3D NULL; @@ -1692,6 +1694,16 @@ virFindFileInPath(const char *file) return abspath; } =20 + /* First search in paths provided by caller. + */ + if (extra_paths) { + for (pathiter =3D extra_paths; *pathiter; pathiter++) { + g_autofree char *fullpath =3D g_strdup_printf("%s/%s", *pathit= er, file); + if (virFileIsExecutable(fullpath)) + return g_steal_pointer(&fullpath); + } + } + /* copy PATH env so we can tweak it */ origpath =3D getenv("PATH"); if (!origpath) diff --git a/src/util/virfile.h b/src/util/virfile.h index b9f7b1766f..eee27c2efc 100644 --- a/src/util/virfile.h +++ b/src/util/virfile.h @@ -184,9 +184,12 @@ int virFileResolveAllLinks(const char *linkpath, int virFileIsLink(const char *linkpath) ATTRIBUTE_NONNULL(1) G_GNUC_WARN_UNUSED_RESULT; =20 -char *virFindFileInPath(const char *file) +char *virFindFileInPathFull(const char *file, + const GStrv extra_paths) G_GNUC_NO_INLINE; =20 +#define virFindFileInPath(file) virFindFileInPathFull(file, NULL) + char *virFileFindResource(const char *filename, const char *builddir, const char *installdir) diff --git a/tests/testutilsqemu.c b/tests/testutilsqemu.c index 1444abc401..1ceceef4a7 100644 --- a/tests/testutilsqemu.c +++ b/tests/testutilsqemu.c @@ -118,7 +118,8 @@ static const char *qemu_default_ram_id[VIR_ARCH_LAST] = =3D { }; =20 char * -virFindFileInPath(const char *file) +virFindFileInPathFull(const char *file, + const GStrv extra_args G_GNUC_UNUSED) { if (g_str_has_prefix(file, "qemu-system") || g_str_equal(file, "qemu-kvm")) { diff --git a/tests/virfirewallmock.c b/tests/virfirewallmock.c index 6b096701c9..a047e56bd9 100644 --- a/tests/virfirewallmock.c +++ b/tests/virfirewallmock.c @@ -20,7 +20,8 @@ #include "virfile.h" =20 char * -virFindFileInPath(const char *file) +virFindFileInPathFull(const char *file, + const GStrv extra_args G_GNUC_UNUSED) { if (file && (g_strrstr(file, "ebtables") || --=20 2.31.1 From nobody Fri May 17 23:38:13 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 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=1621929682; cv=none; d=zohomail.com; s=zohoarc; b=DiFixMbp04eSx/QcT+5W6H6CGKseRYZ8ULzcB0tc341XlQNc3jXW5J8YaqkgF7v4ZGzx1a9hlQymzwWI5cQBa/a/7Zd+Vih8iGO2Ixzh6HwJJ2FwvLmN4gF1u6fgrftkHSm1IzQqWiV2Zv8hXs3wYNWfpR/16lJcQZGNsBdzZbY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1621929682; 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=qrskvKKPW1ZdLbeHmdnyCJ6q7/jXoC2nPRepVH++KZc=; b=f5miQSSqnFTimeb+KRT0LrP7eJbbVA8s9Z58/aCXT7mCP/Wm2BJVDYY+x4LJ2Ya+Jxpy3y5GIfY8nxRP7cIdgq03Wct4oSHGXTN6/HkSMJyIaAFCuvcY1QF3zQv3Ehj4fzf/+1RnT/kQeN0VMOEYIULaAQeLZeYRlb3T+y/E27E= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 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-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1621929682630971.1753531877433; Tue, 25 May 2021 01:01:22 -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-525-_XFTHHUKN_qZ9Jc3tlEp9g-1; Tue, 25 May 2021 04:01:07 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id CE68A6D5C4; Tue, 25 May 2021 08:01:01 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9F8B85D9D3; Tue, 25 May 2021 08:01:01 +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 5F9AB55345; Tue, 25 May 2021 08:01:01 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 14P80oF4021812 for ; Tue, 25 May 2021 04:00:50 -0400 Received: by smtp.corp.redhat.com (Postfix) id 2D29B19CBC; Tue, 25 May 2021 08:00:50 +0000 (UTC) Received: from antique-work.redhat.com (unknown [10.40.193.112]) by smtp.corp.redhat.com (Postfix) with ESMTP id A280918AD4 for ; Tue, 25 May 2021 08:00:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1621929681; 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=qrskvKKPW1ZdLbeHmdnyCJ6q7/jXoC2nPRepVH++KZc=; b=Uz52aGwjSjCUIdOnCHsct8Elfag0OTW3qA4jAOiZSd790Gt3Le3dSNxB0dH83fuS7GttD5 brOc6Rm2CzTBrvksK+SfEbnEzgG5ML2VAIAfPQ7UaohnkgX4tGw8MIKgs6t1xX2zWCkM1h zjs7MbeP+2llKAPmObqT5uHTYFJXOkc= X-MC-Unique: _XFTHHUKN_qZ9Jc3tlEp9g-1 From: Pavel Hrdina To: libvir-list@redhat.com Subject: [PATCH RESEND v3 2/8] qemu_conf: use virFindFileInPathFull for runtime binaries Date: Tue, 25 May 2021 10:00:41 +0200 Message-Id: <15bc43b595af1dfc41ef4d5a494b117a818a37f1.1621929489.git.phrdina@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 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.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com 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" Following patches will stop detecting the full path during compilation so we will need to do it here. Signed-off-by: Pavel Hrdina Reviewed-by: Andrea Bolognani --- src/qemu/qemu_conf.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c index 916a3d36ee..437b3ce2be 100644 --- a/src/qemu/qemu_conf.c +++ b/src/qemu/qemu_conf.c @@ -109,6 +109,12 @@ virQEMUDriverConfig *virQEMUDriverConfigNew(bool privi= leged, const char *root) { g_autoptr(virQEMUDriverConfig) cfg =3D NULL; + const char *qemu_extra_paths[] =3D { + "/usr/libexec", + "/usr/lib/qemu", + "/usr/lib", + NULL, + }; =20 if (virQEMUConfigInitialize() < 0) return NULL; @@ -267,10 +273,14 @@ virQEMUDriverConfig *virQEMUDriverConfigNew(bool priv= ileged, return NULL; } =20 - cfg->bridgeHelperName =3D g_strdup(QEMU_BRIDGE_HELPER); - cfg->prHelperName =3D g_strdup(QEMU_PR_HELPER); - cfg->slirpHelperName =3D g_strdup(QEMU_SLIRP_HELPER); - cfg->dbusDaemonName =3D g_strdup(QEMU_DBUS_DAEMON); + cfg->bridgeHelperName =3D virFindFileInPathFull(QEMU_BRIDGE_HELPER, + (GStrv) qemu_extra_paths= ); + cfg->prHelperName =3D virFindFileInPathFull(QEMU_PR_HELPER, + (GStrv) qemu_extra_paths); + cfg->slirpHelperName =3D virFindFileInPathFull(QEMU_SLIRP_HELPER, + (GStrv) qemu_extra_paths); + cfg->dbusDaemonName =3D virFindFileInPathFull(QEMU_DBUS_DAEMON, + (GStrv) qemu_extra_paths); =20 cfg->securityDefaultConfined =3D true; cfg->securityRequireConfined =3D false; --=20 2.31.1 From nobody Fri May 17 23:38:13 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 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=1621929662; cv=none; d=zohomail.com; s=zohoarc; b=H04+4E/buchdY47xpbPXSserXVnwsNGROS0sZZvhPx/OKG4bDJeCGAG7LU7AfZQCe189faDOTNFBTOtExm6+w9rJUAhYC+uZxevT63HDS8DTAHO8xChXrYx0LhVWzqtUeUdL0vd6EU7DCf8H2NopiuCP1wLZhkePNK7ud2wLcZA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1621929662; 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=CcVB2cYIiDmsSPLiuPoez3TSQYo96C+4rvNiC4DCRdY=; b=G25/zwbBLXl8YHRT5xT6bVw8AsjoBf90c++e/8tmMpZfGhm9C3hfy/uB31QUM6W1qhYmyUd7adMh4gYLtNZ8Zbt8molGxc/xZEGzzemuJ6+BJeen+HqQOXa7XUnJA3jFXQQawG3NLgrOS5fhmnttGRsPrMPJWF3hXH8+WtXcnX8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 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-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1621929662665648.4917397341893; Tue, 25 May 2021 01:01:02 -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-176-62y7MxXpMXixKCpMw8hq0Q-1; Tue, 25 May 2021 04:00:58 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 4A7B48042AC; Tue, 25 May 2021 08:00:54 +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 2E2A66C32D; Tue, 25 May 2021 08:00:54 +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 E9760180102A; Tue, 25 May 2021 08:00:53 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 14P80pT3021817 for ; Tue, 25 May 2021 04:00:51 -0400 Received: by smtp.corp.redhat.com (Postfix) id 0C43118AD4; Tue, 25 May 2021 08:00:51 +0000 (UTC) Received: from antique-work.redhat.com (unknown [10.40.193.112]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7FE15189C7 for ; Tue, 25 May 2021 08:00:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1621929661; 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=CcVB2cYIiDmsSPLiuPoez3TSQYo96C+4rvNiC4DCRdY=; b=M+GZglj+GoD5NT+FRx4O660lx37yJN0uAShoaV/bdIV5rlNTO6nzUuloE+jXPIoDUw+csn QlxgIKZYXvgOZh4N9fl8YMSXhYg1OvLuh82klcRLE2UKZlxeVGEJBze0dpsMnLFr82G+1p m/b8o1cMDmiBiv/TU0eQGmZAuCsyiBw= X-MC-Unique: 62y7MxXpMXixKCpMw8hq0Q-1 From: Pavel Hrdina To: libvir-list@redhat.com Subject: [PATCH RESEND v3 3/8] meson: drop check for runtime binary dependencies Date: Tue, 25 May 2021 10:00:42 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 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.11 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com 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" These binaries are used only during runtime so technically there is no need to check for them while compiling libvirt. Usually the location is the same while compiling and running but it may not be true. In addition they are not strictly required to compile the code so this way developers don't have to install it or create fake binaries in order to compile the code. Signed-off-by: Pavel Hrdina --- meson.build | 63 ---------------------------- src/network/bridge_driver.c | 2 + src/node_device/node_device_driver.c | 2 + src/qemu/qemu_conf.c | 5 +++ src/storage/storage_util.c | 2 + src/util/virdnsmasq.c | 1 + src/util/virfirewall.h | 4 ++ src/util/virkmod.h | 3 ++ src/util/virnetdevbandwidth.h | 2 + src/util/virnetdevip.c | 2 + src/util/virnetdevmidonet.c | 2 + src/util/virnetdevopenvswitch.c | 2 + src/util/virsysinfo.c | 1 + src/util/virutil.c | 2 + 14 files changed, 30 insertions(+), 63 deletions(-) diff --git a/meson.build b/meson.build index 4f23f9104e..ed4afd2052 100644 --- a/meson.build +++ b/meson.build @@ -823,24 +823,9 @@ endforeach =20 optional_programs =3D [ 'augparse', - 'dmidecode', - 'dnsmasq', - 'ebtables', 'flake8', - 'ip', - 'ip6tables', - 'iptables', 'iscsiadm', - 'mdevctl', - 'mm-ctl', - 'modprobe', - 'ovs-vsctl', 'pdwtags', - 'radvd', - 'rmmod', - 'scrub', - 'tc', - 'udevadm', ] =20 foreach name : optional_programs @@ -1646,54 +1631,6 @@ if not get_option('driver_qemu').disabled() endif conf.set_quoted('QEMU_USER', qemu_user) conf.set_quoted('QEMU_GROUP', qemu_group) - - qemu_bridge_prog =3D find_program( - 'qemu-bridge-helper', - dirs: [ '/usr/libexec', '/usr/lib/qemu', '/usr/lib' ], - required: false - ) - if qemu_bridge_prog.found() - qemu_bridge_path =3D qemu_bridge_prog.path() - else - qemu_bridge_path =3D '/usr/libexec/qemu-bridge-helper' - endif - conf.set_quoted('QEMU_BRIDGE_HELPER', qemu_bridge_path) - - qemu_pr_prog =3D find_program( - 'qemu-pr-helper', - dirs: [ '/usr/bin', '/usr/libexec' ], - required: false - ) - if qemu_pr_prog.found() - qemu_pr_path =3D qemu_pr_prog.path() - else - qemu_pr_path =3D '/usr/bin/qemu-pr-helper' - endif - conf.set_quoted('QEMU_PR_HELPER', qemu_pr_path) - - qemu_slirp_prog =3D find_program( - 'slirp-helper', - dirs: [ '/usr/bin', '/usr/libexec' ], - required: false - ) - if qemu_slirp_prog.found() - qemu_slirp_path =3D qemu_slirp_prog.path() - else - qemu_slirp_path =3D '/usr/bin/slirp-helper' - endif - conf.set_quoted('QEMU_SLIRP_HELPER', qemu_slirp_path) - - qemu_dbus_daemon_prog =3D find_program( - 'dbus-daemon', - dirs: [ '/usr/bin', '/usr/libexec' ], - required: false - ) - if qemu_dbus_daemon_prog.found() - qemu_dbus_daemon_path =3D qemu_dbus_daemon_prog.path() - else - qemu_dbus_daemon_path =3D '/usr/bin/dbus-daemon' - endif - conf.set_quoted('QEMU_DBUS_DAEMON', qemu_dbus_daemon_path) endif endif =20 diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c index a711b34c48..81d0c06ec5 100644 --- a/src/network/bridge_driver.c +++ b/src/network/bridge_driver.c @@ -74,6 +74,8 @@ #define VIR_FROM_THIS VIR_FROM_NETWORK #define MAX_BRIDGE_ID 256 =20 +#define RADVD "radvd" + static virMutex bridgeNameValidateMutex =3D VIR_MUTEX_INITIALIZER; =20 /** diff --git a/src/node_device/node_device_driver.c b/src/node_device/node_de= vice_driver.c index a9f605715b..72edbc3fa0 100644 --- a/src/node_device/node_device_driver.c +++ b/src/node_device/node_device_driver.c @@ -48,6 +48,8 @@ =20 VIR_LOG_INIT("node_device.node_device_driver"); =20 +#define MDEVCTL "mdevctl" + virNodeDeviceDriverState *driver; =20 =20 diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c index 437b3ce2be..d228504d8c 100644 --- a/src/qemu/qemu_conf.c +++ b/src/qemu/qemu_conf.c @@ -55,6 +55,11 @@ =20 VIR_LOG_INIT("qemu.qemu_conf"); =20 +#define QEMU_BRIDGE_HELPER "qemu-bridge-helper" +#define QEMU_PR_HELPER "qemu-pr-helper" +#define QEMU_SLIRP_HELPER "slirp-helper" +#define QEMU_DBUS_DAEMON "dbus-daemon" + /* These are only defaults, they can be changed now in qemu.conf and * explicitly specified port is checked against these two (makes * sense to limit the values). diff --git a/src/storage/storage_util.c b/src/storage/storage_util.c index a7c9355bf9..b43ea7b757 100644 --- a/src/storage/storage_util.c +++ b/src/storage/storage_util.c @@ -85,6 +85,8 @@ VIR_LOG_INIT("storage.storage_util"); # define S_IRWXUGO (S_IRWXU | S_IRWXG | S_IRWXO) #endif =20 +#define SCRUB "scrub" + /* virStorageBackendNamespaceInit: * @poolType: virStoragePoolType * @xmlns: Storage Pool specific namespace callback methods diff --git a/src/util/virdnsmasq.c b/src/util/virdnsmasq.c index f2f606913f..b666c2f9d3 100644 --- a/src/util/virdnsmasq.c +++ b/src/util/virdnsmasq.c @@ -48,6 +48,7 @@ VIR_LOG_INIT("util.dnsmasq"); =20 #define DNSMASQ_HOSTSFILE_SUFFIX "hostsfile" #define DNSMASQ_ADDNHOSTSFILE_SUFFIX "addnhosts" +#define DNSMASQ "dnsmasq" =20 static void dhcphostFreeContent(dnsmasqDhcpHost *host) diff --git a/src/util/virfirewall.h b/src/util/virfirewall.h index 169d99fe2b..a3954c5ed0 100644 --- a/src/util/virfirewall.h +++ b/src/util/virfirewall.h @@ -22,6 +22,10 @@ =20 #include "internal.h" =20 +#define EBTABLES_PATH "ebtables" +#define IPTABLES_PATH "iptables" +#define IP6TABLES_PATH "ip6tables" + typedef struct _virFirewall virFirewall; =20 typedef struct _virFirewallRule virFirewallRule; diff --git a/src/util/virkmod.h b/src/util/virkmod.h index bb043d4876..58311909eb 100644 --- a/src/util/virkmod.h +++ b/src/util/virkmod.h @@ -23,6 +23,9 @@ =20 #include "internal.h" =20 +#define MODPROBE "modprobe" +#define RMMOD "rmmod" + char *virKModLoad(const char *) ATTRIBUTE_NONNULL(1); char *virKModUnload(const char *) diff --git a/src/util/virnetdevbandwidth.h b/src/util/virnetdevbandwidth.h index 3d520721f6..6c91bd0f33 100644 --- a/src/util/virnetdevbandwidth.h +++ b/src/util/virnetdevbandwidth.h @@ -21,6 +21,8 @@ #include "internal.h" #include "virmacaddr.h" =20 +#define TC "tc" + typedef struct _virNetDevBandwidthRate virNetDevBandwidthRate; struct _virNetDevBandwidthRate { unsigned long long average; /* kbytes/s */ diff --git a/src/util/virnetdevip.c b/src/util/virnetdevip.c index 0ce8f5b536..f4cf6ac39f 100644 --- a/src/util/virnetdevip.c +++ b/src/util/virnetdevip.c @@ -50,6 +50,8 @@ =20 #define VIR_FROM_THIS VIR_FROM_NONE =20 +#define IP_PATH "ip" + VIR_LOG_INIT("util.netdevip"); =20 #if defined(WITH_LIBNL) diff --git a/src/util/virnetdevmidonet.c b/src/util/virnetdevmidonet.c index 9061f1516f..735607e5df 100644 --- a/src/util/virnetdevmidonet.c +++ b/src/util/virnetdevmidonet.c @@ -26,6 +26,8 @@ =20 #define VIR_FROM_THIS VIR_FROM_NONE =20 +#define MM_CTL "mm-ctl" + /** * virNetDevMidonetBindPort: * @ifname: the network interface name diff --git a/src/util/virnetdevopenvswitch.c b/src/util/virnetdevopenvswitc= h.c index 21ee4bdd42..a05128dbca 100644 --- a/src/util/virnetdevopenvswitch.c +++ b/src/util/virnetdevopenvswitch.c @@ -35,6 +35,8 @@ =20 VIR_LOG_INIT("util.netdevopenvswitch"); =20 +#define OVS_VSCTL "ovs-vsctl" + /* * Set openvswitch default timeout */ diff --git a/src/util/virsysinfo.c b/src/util/virsysinfo.c index af9e03c5ac..8bbda9ea69 100644 --- a/src/util/virsysinfo.c +++ b/src/util/virsysinfo.c @@ -53,6 +53,7 @@ static const char *sysinfoCpuinfo =3D "/proc/cpuinfo"; #define SYSINFO sysinfoSysinfo #define CPUINFO sysinfoCpuinfo #define CPUINFO_FILE_LEN (1024*1024) /* 1MB limit for /proc/cpuinfo fil= e */ +#define DMIDECODE "dmidecode" =20 =20 void diff --git a/src/util/virutil.c b/src/util/virutil.c index 311cbbf93a..757fb1439d 100644 --- a/src/util/virutil.c +++ b/src/util/virutil.c @@ -57,6 +57,8 @@ #include "virutil.h" #include "virsocket.h" =20 +#define UDEVADM "udevadm" + G_STATIC_ASSERT(sizeof(gid_t) <=3D sizeof(unsigned int) && sizeof(uid_t) <=3D sizeof(unsigned int)); =20 --=20 2.31.1 From nobody Fri May 17 23:38:13 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 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=1621929673; cv=none; d=zohomail.com; s=zohoarc; b=HVRPy3kTyhDy0/LCZXRL+JxfcMQltEdjPpQy43c8U6S8CPecXRpfpi6sIMJHyE2VxrgrhdP2YxmpasdqIMZh6oK8kt+mD9u2hAIdnOKs4SswKhOzcxFwsKz4aKKK8j8/BFzd6VD0VxNKzyLDoUy/uGyBly4Sy7DBI/U8pPy8on8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1621929673; 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=NRWHKyv+uxvef4XCzi30Nepsv+495Q2YsxlEo7ggGio=; b=cQ0EmB/scaGqH6+BnQtzhBWKxoi/4Kf/uB7t8HjN0ymGeAn545RMYYhvDH0WdGBIxUh5SxwplwhMw0etMFLqz6b/l8aYqBhtaVwx1JGnrFAK9bmAeIOdGcj1cbAMk+ateGUgoda6CV2gyiJVnjieRc09QPoO5sWAcN3FUR3s+UE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 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-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 162192967375544.97438186727811; Tue, 25 May 2021 01:01:13 -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-16-JkrCjEFzO1W8WxWc1ie_qQ-1; Tue, 25 May 2021 04:01:10 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 718BF6DD3F; Tue, 25 May 2021 08:01:05 +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 33FFD100E113; Tue, 25 May 2021 08:01:05 +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 DB5D8180B464; Tue, 25 May 2021 08:01:04 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 14P80pMY021827 for ; Tue, 25 May 2021 04:00:51 -0400 Received: by smtp.corp.redhat.com (Postfix) id E439F18AD4; Tue, 25 May 2021 08:00:51 +0000 (UTC) Received: from antique-work.redhat.com (unknown [10.40.193.112]) by smtp.corp.redhat.com (Postfix) with ESMTP id 60640189C7 for ; Tue, 25 May 2021 08:00:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1621929672; 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=NRWHKyv+uxvef4XCzi30Nepsv+495Q2YsxlEo7ggGio=; b=ifgKMODJvx2n5ClZhWj2Eto6LlQFD8Hpiuh1bYf8FX2o1Clxf/9z5rDD2E5k1IOSK5pbyw PVZ6WRQS6HI8gum6lGlHrjORPMOU2uF6ZRge4culPBqFv0/yHaLkFfpKJdcMWmz2FiH+vD faeMwSgUQpHaQYEfBvMNLlwUaYV07/U= X-MC-Unique: JkrCjEFzO1W8WxWc1ie_qQ-1 From: Pavel Hrdina To: libvir-list@redhat.com Subject: [PATCH RESEND v3 4/8] meson: move iscsiadm check into storage_iscsi condition Date: Tue, 25 May 2021 10:00:43 +0200 Message-Id: <242b64244d53728097a9e626ad9ecf0635adea5c.1621929489.git.phrdina@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 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.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com 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" This requires to define the binary name in code because we compile src/util/viriscsi.c unconditionally. Signed-off-by: Pavel Hrdina --- meson.build | 22 ++++++++++++++++------ src/util/viriscsi.h | 2 ++ 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/meson.build b/meson.build index ed4afd2052..7eeaa689f9 100644 --- a/meson.build +++ b/meson.build @@ -824,7 +824,6 @@ endforeach optional_programs =3D [ 'augparse', 'flake8', - 'iscsiadm', 'pdwtags', ] =20 @@ -1742,11 +1741,22 @@ if conf.has('WITH_LIBVIRTD') error('Need glusterfs (libgfapi) for gluster storage driver') endif =20 - if not get_option('storage_iscsi').disabled() and iscsiadm_prog.found() - use_storage =3D true - conf.set('WITH_STORAGE_ISCSI', 1) - elif get_option('storage_iscsi').enabled() - error('We need iscsiadm for iSCSI storage driver') + if not get_option('storage_iscsi').disabled() + iscsi_enable =3D true + iscsiadm_prog =3D find_program('iscsiadm', required: false, dirs: libv= irt_sbin_path) + + if not iscsiadm_prog.found() + if get_option('storage_iscsi').enabled() + error('We need iscsiadm for iSCSI storage driver') + else + iscsi_enable =3D false + endif + endif + + if iscsi_enable + use_storage =3D true + conf.set('WITH_STORAGE_ISCSI', 1) + endif endif =20 if not get_option('storage_iscsi_direct').disabled() and libiscsi_dep.fo= und() diff --git a/src/util/viriscsi.h b/src/util/viriscsi.h index 6d17d139eb..fa7ff280c2 100644 --- a/src/util/viriscsi.h +++ b/src/util/viriscsi.h @@ -23,6 +23,8 @@ =20 #include "internal.h" =20 +#define ISCSIADM "iscsiadm" + char * virISCSIGetSession(const char *devpath, bool probe) --=20 2.31.1 From nobody Fri May 17 23:38:13 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 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=1621929670; cv=none; d=zohomail.com; s=zohoarc; b=VMif6eRljnwJ8DwW2ezcugp9ObovmLyVPMdLz+RNj8yWicGi8ngv3hlM5hatPpjSahlLd2ahcps33IIZzSLhf9Qi5dohkSjjZN/z9beeK96L0hw9EI66dl+FHrpfspoqQQ+mtToi8H46vDlM5OMDalsI91RCBh+uYKAP4oi6cj8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1621929670; 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=LtPnZCR2yNwxjJjVkMU/LAN1R1rClVDjgQhgFnpDpD8=; b=VnN5UZCyyhnRBPErULI8xTpfl1CrPx+hPe7s8JmR2gegrgOue06uCj2Xs2gUHAhlTaM0hA/nqe32UGds0EHZIf5jfPFFZBywXrMVLpnHVMa9C5OlcxXskDsk/B704nIpHuMbpjeiXVa/GnLLF15hGiZVbQ6nBQLAnARNghl3OHI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 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-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1621929670310787.4969640352285; Tue, 25 May 2021 01:01:10 -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-486-ltlNgUa9O72xpArU2vy_hA-1; Tue, 25 May 2021 04:01:06 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 0138719253C0; Tue, 25 May 2021 08:01:02 +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 B4F911002EF0; Tue, 25 May 2021 08:01:01 +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 5E0C2180B463; Tue, 25 May 2021 08:01:01 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 14P80qJH021839 for ; Tue, 25 May 2021 04:00:52 -0400 Received: by smtp.corp.redhat.com (Postfix) id C326919CBC; Tue, 25 May 2021 08:00:52 +0000 (UTC) Received: from antique-work.redhat.com (unknown [10.40.193.112]) by smtp.corp.redhat.com (Postfix) with ESMTP id 431D9189C7 for ; Tue, 25 May 2021 08:00:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1621929669; 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=LtPnZCR2yNwxjJjVkMU/LAN1R1rClVDjgQhgFnpDpD8=; b=eMCj72ZP+5fLODzh9Xns1DXaKGhHoEZCgMnTXUJNgAFAQCU9Ku6oakiQaP8L5Y97J5ld/d Wi0IqlYsfJHIXmmE1dFt2uCXHLnAetw7bqW/g2l/pThcVTuMKKluZ0bUaoar8BTkN4hPU9 6Axf1sU8ufPwAw5sfSUXl4E/m0MjHS4= X-MC-Unique: ltlNgUa9O72xpArU2vy_hA-1 From: Pavel Hrdina To: libvir-list@redhat.com Subject: [PATCH RESEND v3 5/8] meson: stop setting runtime binaries defines during compilation Date: Tue, 25 May 2021 10:00:44 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 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.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com 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" Technically the location of these binaries may be different when compiling libvirt or running it. This will allow users to change $PATH to use different binaries as well. Signed-off-by: Pavel Hrdina Reviewed-by: Andrea Bolognani --- meson.build | 41 ++++---------------------- src/bhyve/bhyve_command.c | 4 +++ src/locking/lock_driver_lockd.c | 12 ++------ src/storage/storage_backend_logical.c | 13 ++++++++ src/storage/storage_backend_sheepdog.c | 2 ++ src/storage/storage_backend_zfs.c | 3 ++ src/storage/storage_util.h | 6 ++++ src/util/virnuma.c | 1 + 8 files changed, 36 insertions(+), 46 deletions(-) diff --git a/meson.build b/meson.build index 7eeaa689f9..2900b6e1a8 100644 --- a/meson.build +++ b/meson.build @@ -979,9 +979,7 @@ libparted_version =3D '1.8.0' libparted_dep =3D dependency('libparted', version: '>=3D' + libparted_vers= ion, required: false) if libparted_dep.found() parted_prog =3D find_program('parted', required: false, dirs: libvirt_sb= in_path) - if parted_prog.found() - conf.set_quoted('PARTED', parted_prog.path()) - else + if not parted_prog.found() libparted_dep =3D dependency('', required: false) endif endif @@ -1428,9 +1426,6 @@ if not get_option('driver_bhyve').disabled() and host= _machine.system() =3D=3D 'freeb =20 if bhyve_prog.found() and bhyvectl_prog.found() and bhyveload_prog.found= () conf.set('WITH_BHYVE', 1) - conf.set_quoted('BHYVE', bhyve_prog.path()) - conf.set_quoted('BHYVECTL', bhyvectl_prog.path()) - conf.set_quoted('BHYVELOAD', bhyveload_prog.path()) endif elif get_option('driver_bhyve').enabled() error('The bhyve driver cannot be enabled') @@ -1719,18 +1714,7 @@ if conf.has('WITH_LIBVIRTD') =20 if fs_enable use_storage =3D true - conf.set('WITH_STORAGE_FS', 1) - conf.set_quoted('MOUNT', mount_prog.path()) - conf.set_quoted('UMOUNT', umount_prog.path()) - conf.set_quoted('MKFS', mkfs_prog.path()) - - showmount_prog =3D find_program('showmount', required: false, dirs: = libvirt_sbin_path) - showmount_path =3D '' - if showmount_prog.found() - showmount_path =3D showmount_prog.path() - endif - conf.set_quoted('SHOWMOUNT', showmount_path) endif endif =20 @@ -1775,11 +1759,8 @@ if conf.has('WITH_LIBVIRTD') '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_prog =3D find_program(name, required: get_option('storage_lvm'),= dirs: libvirt_sbin_path) + if not lvm_prog.found() lvm_enable =3D false endif endforeach @@ -1787,10 +1768,6 @@ if conf.has('WITH_LIBVIRTD') 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 =20 @@ -1819,7 +1796,6 @@ if conf.has('WITH_LIBVIRTD') if sheepdogcli_prog.found() use_storage =3D true conf.set('WITH_STORAGE_SHEEPDOG', 1) - conf.set_quoted('SHEEPDOGCLI', sheepdogcli_prog.path()) endif endif =20 @@ -1842,11 +1818,8 @@ if conf.has('WITH_LIBVIRTD') 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_prog =3D find_program(name, required: get_option('storage_zfs'),= dirs: libvirt_sbin_path) + if not zfs_prog.found() zfs_enable =3D false endif endforeach @@ -1854,9 +1827,6 @@ if conf.has('WITH_LIBVIRTD') 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 @@ -1970,7 +1940,6 @@ if not get_option('numad').disabled() and numactl_dep= .found() numad_prog =3D find_program('numad', required: get_option('numad'), dirs= : libvirt_sbin_path) if numad_prog.found() conf.set('WITH_NUMAD', 1) - conf.set_quoted('NUMAD', numad_prog.path()) endif elif get_option('numad').enabled() error('You must have numactl enabled for numad support.') diff --git a/src/bhyve/bhyve_command.c b/src/bhyve/bhyve_command.c index ab9d3026cc..71293e039f 100644 --- a/src/bhyve/bhyve_command.c +++ b/src/bhyve/bhyve_command.c @@ -37,6 +37,10 @@ =20 #define VIR_FROM_THIS VIR_FROM_BHYVE =20 +#define BHYVE "bhyve" +#define BHYVECTL "bhyvectl" +#define BHYVELOAD "bhyveload" + VIR_LOG_INIT("bhyve.bhyve_command"); =20 static int diff --git a/src/locking/lock_driver_lockd.c b/src/locking/lock_driver_lock= d.c index 823b918db3..ea787bf87d 100644 --- a/src/locking/lock_driver_lockd.c +++ b/src/locking/lock_driver_lockd.c @@ -454,7 +454,8 @@ static int virLockManagerLockDaemonNew(virLockManager *= lock, } =20 =20 -#ifdef LVS +#define LVS "lvs" + static int virLockManagerGetLVMKey(const char *path, char **key) @@ -508,15 +509,6 @@ virLockManagerGetLVMKey(const char *path, =20 return ret; } -#else -static int -virLockManagerGetLVMKey(const char *path, - char **key G_GNUC_UNUSED) -{ - virReportSystemError(ENOSYS, _("Unable to get LVM key for %s"), path); - return -1; -} -#endif =20 =20 static int virLockManagerLockDaemonAddResource(virLockManager *lock, diff --git a/src/storage/storage_backend_logical.c b/src/storage/storage_ba= ckend_logical.c index ed8e47d880..4bbb585d07 100644 --- a/src/storage/storage_backend_logical.c +++ b/src/storage/storage_backend_logical.c @@ -40,6 +40,19 @@ =20 VIR_LOG_INIT("storage.storage_backend_logical"); =20 +#define PVCREATE "pvcreate" +#define PVREMOVE "pvremove" +#define PVS "pvs" +#define VGCREATE "vgcreate" +#define VGREMOVE "vgremove" +#define VGCHANGE "vgchange" +#define VGSCAN "vgscan" +#define VGS "vgs" +#define LVCREATE "lvcreate" +#define LVREMOVE "lvremove" +#define LVCHANGE "lvchange" +#define LVS "lvs" + =20 static int virStorageBackendLogicalSetActive(virStoragePoolObj *pool, diff --git a/src/storage/storage_backend_sheepdog.c b/src/storage/storage_b= ackend_sheepdog.c index 6490dfae52..beb6445e1e 100644 --- a/src/storage/storage_backend_sheepdog.c +++ b/src/storage/storage_backend_sheepdog.c @@ -35,6 +35,8 @@ =20 #define VIR_FROM_THIS VIR_FROM_STORAGE =20 +#define SHEEPDOGCLI "dog" + static int virStorageBackendSheepdogRefreshVol(virStoragePoolObj *pool, virStorageVolDef *vol); =20 diff --git a/src/storage/storage_backend_zfs.c b/src/storage/storage_backen= d_zfs.c index 6fabeade11..2a5d74357d 100644 --- a/src/storage/storage_backend_zfs.c +++ b/src/storage/storage_backend_zfs.c @@ -33,6 +33,9 @@ =20 VIR_LOG_INIT("storage.storage_backend_zfs"); =20 +#define ZFS "zfs" +#define ZPOOL "zpool" + /* * Some common flags of zfs and zpool commands we use: * -H -- don't print headers and separate fields by tab diff --git a/src/storage/storage_util.h b/src/storage/storage_util.h index aa3c25e9fc..487345ff22 100644 --- a/src/storage/storage_util.h +++ b/src/storage/storage_util.h @@ -25,6 +25,12 @@ #include "storage_driver.h" #include "storage_backend.h" =20 +#define PARTED "parted" +#define MOUNT "mount" +#define UMOUNT "umount" +#define MKFS "mkfs" +#define SHOWMOUNT "showmount" + /* Storage Pool Namespace options to share w/ storage_backend_fs.c and * the virStorageBackendFileSystemMountCmd method */ typedef struct _virStoragePoolFSMountOptionsDef virStoragePoolFSMountOptio= nsDef; diff --git a/src/util/virnuma.c b/src/util/virnuma.c index 31f65d8902..d3cdc3ba53 100644 --- a/src/util/virnuma.c +++ b/src/util/virnuma.c @@ -52,6 +52,7 @@ =20 VIR_LOG_INIT("util.numa"); =20 +#define NUMAD "numad" =20 #if WITH_NUMAD char * --=20 2.31.1 From nobody Fri May 17 23:38:13 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 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=1621929724; cv=none; d=zohomail.com; s=zohoarc; b=mukWDDv8avV1K9gie+QFLUCKDTZpZVlF3+3NuO3vbINCo88M5yBBy+vXiTFok9AK1Bt1UCW+kXRLdNuHbwgVII1aEZhUAK+UOPLHnzTU8jmI7QP3OeV0pD0kWjSQM3/dpPOUk5oyBCVxUXEBxaQ7zLLt1RX1G4hiGNCWgawxf30= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1621929724; 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=nvWV0Dg1Tw/v/6Po+mn9GUr5a2bAJqkKSKRfjw8rJbY=; b=iNd/4DiXDAErRg8w0mMrTAdJX/qStvfb418W1OEViD8XydCGikShIjR5auBv3rEokdQ8Y8qfRBLfPgEMr78TjzkcpzLConUr9AvZkwLFY7EE7OFRVHbXZtGsYrgtvsUrmEVHSTJ+C0Xz9oz91Dc9mdEi9I3da19D6bB66lcP/nM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 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-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 162192972456593.77872760053049; Tue, 25 May 2021 01:02: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-148-J_DgiRsBPWClTy4RyoiYJA-1; Tue, 25 May 2021 04:01:13 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 868481074649; Tue, 25 May 2021 08:01:08 +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 632426C32D; Tue, 25 May 2021 08:01:08 +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 1A306180140D; Tue, 25 May 2021 08:01:08 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 14P80r3l021846 for ; Tue, 25 May 2021 04:00:53 -0400 Received: by smtp.corp.redhat.com (Postfix) id A1902189C7; Tue, 25 May 2021 08:00:53 +0000 (UTC) Received: from antique-work.redhat.com (unknown [10.40.193.112]) by smtp.corp.redhat.com (Postfix) with ESMTP id 21D5A59443 for ; Tue, 25 May 2021 08:00:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1621929723; 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=nvWV0Dg1Tw/v/6Po+mn9GUr5a2bAJqkKSKRfjw8rJbY=; b=Hwud4oeF4+4oU/pKCNKzYsUmBiG6jAio3Tuusyg4B9/u/6sOnvDbAf97RiD/wJwmf3Vd01 uKz6iU557I+kt1K1DwN5V8m0TV1hufYZgmA8uTzau2mSvQwHJoFwShj3TRW/NpxXTCC7/Z Bza1RrlKS8TuD/g0831XK2idrisel30= X-MC-Unique: J_DgiRsBPWClTy4RyoiYJA-1 From: Pavel Hrdina To: libvir-list@redhat.com Subject: [PATCH RESEND v3 6/8] meson: use runtime binaries to only resolve features with "auto" value Date: Tue, 25 May 2021 10:00:45 +0200 Message-Id: <2a975b2ec39a0bbd636d2019036cbb52e2d6f649.1621929489.git.phrdina@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 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.11 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com 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" This way meson will try to do the right thing by default but we will allow users to change this behavior by using -Dname=3Denabled. This comes with two benefits compared to the previous behavior: - no need to install the binaries if developers would like to check that the code compiles correctly - package maintainers can drop some build dependencies Signed-off-by: Pavel Hrdina Reviewed-by: Andrea Bolognani --- meson.build | 102 ++++++++++++++++++++++++++++++++-------------------- 1 file changed, 63 insertions(+), 39 deletions(-) diff --git a/meson.build b/meson.build index 2900b6e1a8..8e8d31953d 100644 --- a/meson.build +++ b/meson.build @@ -977,12 +977,6 @@ endif =20 libparted_version =3D '1.8.0' libparted_dep =3D dependency('libparted', version: '>=3D' + libparted_vers= ion, required: false) -if libparted_dep.found() - parted_prog =3D find_program('parted', required: false, dirs: libvirt_sb= in_path) - if not parted_prog.found() - libparted_dep =3D dependency('', required: false) - endif -endif =20 libpcap_version =3D '1.5.0' if not get_option('libpcap').disabled() @@ -1420,11 +1414,17 @@ if not get_option('driver_libvirtd').disabled() endif =20 if not get_option('driver_bhyve').disabled() and host_machine.system() =3D= =3D 'freebsd' - bhyve_prog =3D find_program('bhyve', required: get_option('driver_bhyve'= )) - bhyvectl_prog =3D find_program('bhyvectl', required: get_option('driver_= bhyve')) - bhyveload_prog =3D find_program('bhyveload', required: get_option('drive= r_bhyve')) + bhyve_enable =3D true =20 - if bhyve_prog.found() and bhyvectl_prog.found() and bhyveload_prog.found= () + if get_option('driver_bhyve').auto() + bhyve_prog =3D find_program('bhyve', required: false) + bhyvectl_prog =3D find_program('bhyvectl', required: false) + bhyveload_prog =3D find_program('bhyveload', required: false) + + bhyve_enable =3D bhyve_prog.found() and bhyvectl_prog.found() and bhyv= eload_prog.found() + endif + + if bhyve_enable conf.set('WITH_BHYVE', 1) endif elif get_option('driver_bhyve').enabled() @@ -1680,8 +1680,17 @@ if conf.has('WITH_LIBVIRTD') endif =20 if not get_option('storage_disk').disabled() and devmapper_dep.found() a= nd libparted_dep.found() - use_storage =3D true - conf.set('WITH_STORAGE_DISK', 1) + disk_enable =3D true + + if get_option('storage_disk').auto() + parted_prog =3D find_program('parted', required: false, dirs: libvir= t_sbin_path) + disk_enable =3D parted_prog.found() + endif + + if disk_enable + use_storage =3D true + conf.set('WITH_STORAGE_DISK', 1) + endif elif get_option('storage_disk').enabled() error('You must install libparted and libdevmapper to compile libvirt = with disk storage driver') endif @@ -1702,10 +1711,10 @@ if conf.has('WITH_LIBVIRTD') endif endif =20 - if fs_enable - mount_prog =3D find_program('mount', required: get_option('storage_f= s'), dirs: libvirt_sbin_path) - umount_prog =3D find_program('umount', required: get_option('storage= _fs'), dirs: libvirt_sbin_path) - mkfs_prog =3D find_program('mkfs', required: get_option('storage_fs'= ), dirs: libvirt_sbin_path) + if fs_enable and get_option('storage_fs').auto() + mount_prog =3D find_program('mount', required: false, dirs: libvirt_= sbin_path) + umount_prog =3D find_program('umount', required: false, dirs: libvir= t_sbin_path) + mkfs_prog =3D find_program('mkfs', required: false, dirs: libvirt_sb= in_path) =20 if not mount_prog.found() or not umount_prog.found() or not mkfs_pro= g.found() fs_enable =3D false @@ -1727,14 +1736,11 @@ if conf.has('WITH_LIBVIRTD') =20 if not get_option('storage_iscsi').disabled() iscsi_enable =3D true - iscsiadm_prog =3D find_program('iscsiadm', required: false, dirs: libv= irt_sbin_path) =20 - if not iscsiadm_prog.found() - if get_option('storage_iscsi').enabled() - error('We need iscsiadm for iSCSI storage driver') - else - iscsi_enable =3D false - endif + if get_option('storage_iscsi').auto() + iscsiadm_prog =3D find_program('iscsiadm', required: false, dirs: li= bvirt_sbin_path) + + iscsi_enable =3D iscsiadm_prog.found() endif =20 if iscsi_enable @@ -1758,12 +1764,15 @@ if conf.has('WITH_LIBVIRTD') 'lvchange', 'vgchange', 'vgscan', 'pvs', 'vgs', 'lvs', ] - foreach name : lvm_progs - lvm_prog =3D find_program(name, required: get_option('storage_lvm'),= dirs: libvirt_sbin_path) - if not lvm_prog.found() - lvm_enable =3D false - endif - endforeach + + if get_option('storage_lvm').auto() + foreach name : lvm_progs + lvm_prog =3D find_program(name, required: false, dirs: libvirt_sbi= n_path) + if not lvm_prog.found() + lvm_enable =3D false + endif + endforeach + endif =20 if lvm_enable use_storage =3D true @@ -1791,9 +1800,15 @@ if conf.has('WITH_LIBVIRTD') endif =20 if not get_option('storage_sheepdog').disabled() - sheepdogcli_prog =3D find_program('dog', required: get_option('storage= _sheepdog'), dirs: libvirt_sbin_path) + sheepdog_enable =3D true =20 - if sheepdogcli_prog.found() + if get_option('storage_sheepdog').auto() + sheepdogcli_prog =3D find_program('dog', required: false, dirs: libv= irt_sbin_path) + + sheepdog_enable =3D sheepdogcli_prog.found() + endif + + if sheepdog_enable use_storage =3D true conf.set('WITH_STORAGE_SHEEPDOG', 1) endif @@ -1817,12 +1832,15 @@ if conf.has('WITH_LIBVIRTD') =20 if not get_option('storage_zfs').disabled() zfs_enable =3D true - foreach name : ['zfs', 'zpool'] - zfs_prog =3D find_program(name, required: get_option('storage_zfs'),= dirs: libvirt_sbin_path) - if not zfs_prog.found() - zfs_enable =3D false - endif - endforeach + + if get_option('storage_zfs').auto() + foreach name : ['zfs', 'zpool'] + zfs_prog =3D find_program(name, required: false, dirs: libvirt_sbi= n_path) + if not zfs_prog.found() + zfs_enable =3D false + endif + endforeach + endif =20 if zfs_enable use_storage =3D true @@ -1937,8 +1955,14 @@ if not get_option('nss').disabled() endif =20 if not get_option('numad').disabled() and numactl_dep.found() - numad_prog =3D find_program('numad', required: get_option('numad'), dirs= : libvirt_sbin_path) - if numad_prog.found() + numad_enable =3D true + + if get_option('numad').auto() + numad_prog =3D find_program('numad', required: false, dirs: libvirt_sb= in_path) + numad_enable =3D numad_prog.found() + endif + + if numad_enable conf.set('WITH_NUMAD', 1) endif elif get_option('numad').enabled() --=20 2.31.1 From nobody Fri May 17 23:38:13 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 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=1621929681; cv=none; d=zohomail.com; s=zohoarc; b=Jkkpp7AUor54eYWA8GoKsDvgvKkc2kQM7dfnb1M01y2jl5h20du05iC+z8+gt8gLiUiEoJUhjUodn401cD8+kdg+vQDmjTpqlMQgAm/1h8uCjgXEOvIaXQvCXearkUKm0JrbuoVjqMcOsf9lnlwfg9VuhlacECi8S6LMO+IOzgQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1621929681; 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=N+aKWi2VqH/hjadBZ9HeHg4inVhaSSvJv7mCdfGvHPY=; b=MwTh6OxbtjYSeqHdTi3Cc2kKFxDpbH0cfcHQ5i8C6JzwoApSDKZwPxhJBPLXUgdSMRVC5Ay+CfddCsSjeeB5W029a4hkjF7i0Cba+XHbA2fNTsyNwBMK1naU0g1BeOLg48KvsifUopIoV1qa/OLiFpfLg/kavcHuaqjU1IRlMNA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 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-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1621929681991371.0728848599895; Tue, 25 May 2021 01:01:21 -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-223-Ba7FY1GXPYGdM36XWwt8yg-1; Tue, 25 May 2021 04:01:17 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C6A75108C2AD; Tue, 25 May 2021 08:01:11 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A41BD60BF1; Tue, 25 May 2021 08:01: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 6ACDE55342; Tue, 25 May 2021 08:01:11 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 14P80stw021854 for ; Tue, 25 May 2021 04:00:54 -0400 Received: by smtp.corp.redhat.com (Postfix) id 8393018AD4; Tue, 25 May 2021 08:00:54 +0000 (UTC) Received: from antique-work.redhat.com (unknown [10.40.193.112]) by smtp.corp.redhat.com (Postfix) with ESMTP id 01540189C7 for ; Tue, 25 May 2021 08:00:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1621929681; 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=N+aKWi2VqH/hjadBZ9HeHg4inVhaSSvJv7mCdfGvHPY=; b=QViD/KVF45XmhuuGYCWn8S9kAgU5wE/gvIgW7TJPQuLfvldY7eeC1eIRIpXAjraYkmUw2d 4hEAUFWj+iu4RyI+sFvb6UNEXipiky6vt2TudR+jM4WgT1iXgHHCF4KIP7H9GN739fA+Dx mQL7KJUjlhjWnK411NyIMIdpMlUu9XY= X-MC-Unique: Ba7FY1GXPYGdM36XWwt8yg-1 From: Pavel Hrdina To: libvir-list@redhat.com Subject: [PATCH RESEND v3 7/8] meson: optional_programs should be used only for building libvirt Date: Tue, 25 May 2021 10:00:46 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 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.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com 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" Drop code that creates defines with program paths and update the comment to reflect current usage of optional_programs. Signed-off-by: Pavel Hrdina Reviewed-by: Andrea Bolognani --- meson.build | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/meson.build b/meson.build index 8e8d31953d..1c0de2f408 100644 --- a/meson.build +++ b/meson.build @@ -819,7 +819,7 @@ foreach item : required_programs_groups endforeach =20 =20 -# optional programs +# optional programs used while building libvirt =20 optional_programs =3D [ 'augparse', @@ -830,14 +830,6 @@ optional_programs =3D [ foreach name : optional_programs prog =3D find_program(name, required: false, dirs: libvirt_sbin_path) varname =3D name.underscorify() - if prog.found() - prog_path =3D prog.path() - else - prog_path =3D name - endif - - conf.set_quoted(varname.to_upper(), prog_path) - conf.set_quoted('@0@_PATH'.format(varname.to_upper()), prog_path) set_variable('@0@_prog'.format(varname), prog) endforeach =20 --=20 2.31.1 From nobody Fri May 17 23:38:13 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 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=1621929680; cv=none; d=zohomail.com; s=zohoarc; b=UfND5a8aJrc6jih1EbDofrVeztPC/YrVYM8fd3Jv5CHcr5BEfJruiYJ8hoxxaE9FZgOQvL5PdZM4LhOpy+Ke7kNwD9u3LEMJ9z8azX4I12wo88jLyWS32pl7gH6oiEyp+jZxjkGrZmWwTP/rtw2zIYxUaf9B9GL0kWKLJd33H34= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1621929680; 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=Pgjue4kr+3QGdsOshuqCS/DI1IwvziEwg/lyDYc/SgQ=; b=Y9IGcSsCX18sFpUCLw68GUTzL3Cf00i5rES2/P1qVh5KyPfvi66bKl6ilbCQjLWNGGTG/4A9oHhaORUgEUCn2xNVdNCk3NGJNWaAWcVwmxZTzkk8+SgUbqSFJ+c0ojqeAbR8VkoQ8pvTJCWS1gW8RGQOYX6SfHNusxWTz8TanRU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 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-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 162192968058519.600694947742795; Tue, 25 May 2021 01:01:20 -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-471-T4XuvEnrNqGu0DFJIY2iCg-1; Tue, 25 May 2021 04:01:16 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id ED4021926DAA; Tue, 25 May 2021 08:01:09 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id BF1BC1002EF0; Tue, 25 May 2021 08:01:09 +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 7EE9255341; Tue, 25 May 2021 08:01:09 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 14P80t8L021865 for ; Tue, 25 May 2021 04:00:55 -0400 Received: by smtp.corp.redhat.com (Postfix) id 61D1219CBC; Tue, 25 May 2021 08:00:55 +0000 (UTC) Received: from antique-work.redhat.com (unknown [10.40.193.112]) by smtp.corp.redhat.com (Postfix) with ESMTP id D52CD189C7 for ; Tue, 25 May 2021 08:00:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1621929679; 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=Pgjue4kr+3QGdsOshuqCS/DI1IwvziEwg/lyDYc/SgQ=; b=GDae5taBtpcxThU93tkmtkgkg8YY4AWuMAY/LcATeDK1K2jGGN5U2mH54mkRNEEva8UMTW VCbR4nxcvy8Gw/tYW9aGB14VGiNBLktwYR8Bf2pgH0lqr8G0HNZj7f7kAJwOuRJEkyZ6w/ Yfn/U/T+1vUS3yR9RACp5+Bh1SzYmgM= X-MC-Unique: T4XuvEnrNqGu0DFJIY2iCg-1 From: Pavel Hrdina To: libvir-list@redhat.com Subject: [PATCH RESEND v3 8/8] libvirt.spec: drop no longer required build dependencies Date: Tue, 25 May 2021 10:00:47 +0200 Message-Id: <255fb9ba46bebd46aaca4ede6548f783ea052f13.1621929489.git.phrdina@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 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.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com 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" These are no longer required to build libvirt as they are used during compilation only by meson to detect if some "auto" features should be enabled or not but in spec file we explicitly enable/disable all libvirt features. Signed-off-by: Pavel Hrdina --- libvirt.spec.in | 31 ------------------------------- 1 file changed, 31 deletions(-) diff --git a/libvirt.spec.in b/libvirt.spec.in index f421828d16..a49cd58e38 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -260,10 +260,6 @@ BuildRequires: sanlock-devel >=3D 2.4 BuildRequires: libpcap-devel >=3D 1.5.0 BuildRequires: libnl3-devel BuildRequires: libselinux-devel -BuildRequires: dnsmasq >=3D 2.41 -BuildRequires: iptables -BuildRequires: radvd -BuildRequires: ebtables BuildRequires: module-init-tools BuildRequires: cyrus-sasl-devel BuildRequires: polkit >=3D 0.112 @@ -272,13 +268,7 @@ BuildRequires: util-linux %if %{with_qemu} # For managing ACLs BuildRequires: libacl-devel -# From QEMU RPMs -BuildRequires: /usr/bin/qemu-img %endif -# For LVM drivers -BuildRequires: lvm2 -# For pool type=3Discsi -BuildRequires: iscsi-initiator-utils %if %{with_storage_iscsi_direct} # For pool type=3Discsi-direct BuildRequires: libiscsi-devel @@ -297,15 +287,6 @@ BuildRequires: librbd-devel BuildRequires: glusterfs-api-devel >=3D 3.4.1 BuildRequires: glusterfs-devel >=3D 3.4.1 %endif -%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 @@ -330,21 +311,9 @@ BuildRequires: audit-libs-devel # we need /usr/sbin/dtrace BuildRequires: systemtap-sdt-devel =20 -# For mount/umount in FS driver -BuildRequires: util-linux -# For showmount in FS driver (netfs discovery) -BuildRequires: nfs-utils - # Fedora build root suckage BuildRequires: gawk =20 -# For storage wiping with different algorithms -BuildRequires: scrub - -%if %{with_numad} -BuildRequires: numad -%endif - %if %{with_wireshark} BuildRequires: wireshark-devel %endif --=20 2.31.1