From nobody Fri May 17 08:39:14 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=1619008678; cv=none; d=zohomail.com; s=zohoarc; b=mKAzkDzEDnAy/gUp3lMwSJRD/dcdbRYIkInIN6IRn2e87Oa/DnjlsAJl1YhAiX60ZBgu/9tDmX1NXKq+r9JOxdchyuIJS1vs6FLiM3BgDbV1L2gIim+fxo+CK79TBqxeeevJvN0UN58pyD0bQDGbbCl6W6mCcYz1JF0ArxnI9Ds= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1619008678; 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=NLYXOejDpZkXmRt/jzIUE5ts/1bbndKfjg3m40xmO9U=; b=N6PGiXBggB/rD2RCbkngHP5lEtFdSjnfS+BO2tvATx9TR9POLiaHHgPHsfSunJb/TarkBjfsP2d5C1NUFLy2imTk1UGBXDDoenDVMEJ3Ei7/oNyuvvnbBBXK/peMh22eZpchVqb5iLjR93dMlCK5CM49jBerB4exVe/45BfcaPk= 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 1619008678762970.644257408882; Wed, 21 Apr 2021 05:37:58 -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-241-6b2EZMctPo632eRJVkC1qw-1; Wed, 21 Apr 2021 08:37:54 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C8B62808236; Wed, 21 Apr 2021 12:37:47 +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 AA3585D6A1; Wed, 21 Apr 2021 12:37:47 +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 4049D44A5C; Wed, 21 Apr 2021 12:37:47 +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 13LCbei0013627 for ; Wed, 21 Apr 2021 08:37:40 -0400 Received: by smtp.corp.redhat.com (Postfix) id 6C3DE19744; Wed, 21 Apr 2021 12:37:40 +0000 (UTC) Received: from antique-work.redhat.com (unknown [10.40.195.130]) by smtp.corp.redhat.com (Postfix) with ESMTP id DDD8B1972B for ; Wed, 21 Apr 2021 12:37:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1619008677; 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=NLYXOejDpZkXmRt/jzIUE5ts/1bbndKfjg3m40xmO9U=; b=Yxb2JIePAGpIbVByhPNF+tkAbG7PmSn7AtxhEM7fImw7gngHgWlIhrsYc39savWNpuz10L CB17eL0OUInRbVm+zq8Xqt65VgUrnHUfomIifex4kld9EHL/ekCo3ajuhge4NoACvmlCcV oPS/B92wj1c8lwOGJWWb1u17IhjxdI4= X-MC-Unique: 6b2EZMctPo632eRJVkC1qw-1 From: Pavel Hrdina To: libvir-list@redhat.com Subject: [libvirt PATCH v3 1/8] virfile: introduce virFindFileInPathFull() Date: Wed, 21 Apr 2021 14:37:24 +0200 Message-Id: <12d723707faabe2665f42e8906d7285f5cd03d4d.1619008487.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.15 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 --- 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 abd3dc4bd1..717686ddee 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -2254,7 +2254,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 7451929807..8aee189eac 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.30.2 From nobody Fri May 17 08:39:14 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=1619008672; cv=none; d=zohomail.com; s=zohoarc; b=jnZZJEiRhz1LN/3Fzh04iUTsV8F5507o2d0NCstsY0tWBXbzk9NYlatViecmQqRbYTmIdJR0xLGr2uegH3yF2K98/lO3svR9MF7NGR83KnetujVvPrIAO32avUhGvirqMo4YkhsFA01+6K8lN36GhN3L1mWtVtsGjVkHndH1gGk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1619008672; 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=CYcwflTvjDhLci/ii+KVsnfoDf8FkiSF1zEB1E1t+x8=; b=dJj73CXh+GS0GWZ49PkL9zicu9G8nG0pfsTQ5Si6gGShM/Z5hglKfIgCvSN0DTqXTjS0qs/wOwirx/I6Kgg0wmmLgGNBdWSFRQppGsKsYZdYRRyQ6t/vu42BA/btRXmRTlggP4SOcHg0NJ+suKtHalWFq4yyNgVbbzvHTRQvnIo= 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 1619008672141912.3981905041604; Wed, 21 Apr 2021 05:37:52 -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-453-y8zB7xi3MkyDPQFlHm6UwA-1; Wed, 21 Apr 2021 08:37:49 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 29740107ACE3; Wed, 21 Apr 2021 12:37:43 +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 F08D31972B; Wed, 21 Apr 2021 12:37:42 +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 BB34B1806D1C; Wed, 21 Apr 2021 12:37:42 +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 13LCbfTp013637 for ; Wed, 21 Apr 2021 08:37:41 -0400 Received: by smtp.corp.redhat.com (Postfix) id 4CD2519D9B; Wed, 21 Apr 2021 12:37:41 +0000 (UTC) Received: from antique-work.redhat.com (unknown [10.40.195.130]) by smtp.corp.redhat.com (Postfix) with ESMTP id BFCA519726 for ; Wed, 21 Apr 2021 12:37:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1619008671; 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=CYcwflTvjDhLci/ii+KVsnfoDf8FkiSF1zEB1E1t+x8=; b=UYJY34sVetC5l/mwkGeS3BPTuhyc3PEBlqUuG2ET0P/t3F52DTbHSZv4OcAt8JLJwBc0wH pgr2FipD19QicCID+dhoqB/Y7HFl3y8l8wyg0rYVy6yBRlVjQ381nl3MyClmjyVdpRhBhf p7WyceeuKr5z/DEcJ5LsleWMesSuk68= X-MC-Unique: y8zB7xi3MkyDPQFlHm6UwA-1 From: Pavel Hrdina To: libvir-list@redhat.com Subject: [libvirt PATCH v3 2/8] qemu_conf: use virFindFileInPathFull for runtime binaries Date: Wed, 21 Apr 2021 14:37:25 +0200 Message-Id: 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.84 on 10.5.11.23 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 --- 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.30.2 From nobody Fri May 17 08:39:14 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=1619008864; cv=none; d=zohomail.com; s=zohoarc; b=mF6PDJqAkA/cIwlddhdCqEbuJ/Jpo2GdI8nMpv25gwTUfU9yt4rMjasDreu4Gyxa1adS8Zp30KzPCa+j09knb/NFCWRMfbCb/Jv5GvvmTjmd2e3Pv4bqmTIg6t1Zysj6PwMbTJpuEXB0pbiCG5d+1JYJ1S6X4qqAnMEhsFoZ6Pc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1619008864; 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=v0IIwN8CQTzkcuNlJivClT2zpKhxZLWTx4HP3ynqkxE=; b=nq0ymHwNiFUgXpG+UD6iYRf+qO4LEApl6zfqOb0aBxD6/gdGgAjORFS9gj1cLi1goagGi5heQcYiQ5+5eHyoY1CYH8TwwYKDYz2nBUmf9tN6UHcFuM7LHoZKuk6QCL6sHDJmniCh+mq7EnDsr9sdCve/JAURKlAuY/d2o2WxzqA= 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 1619008864425545.2258397264153; Wed, 21 Apr 2021 05:41: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-17-GKCP4UflNZK_w4NRrj8Csg-1; Wed, 21 Apr 2021 08:37:54 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 9EDE019253D2; Wed, 21 Apr 2021 12:37:47 +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 7464C19D80; Wed, 21 Apr 2021 12:37:47 +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 4135D1806D20; Wed, 21 Apr 2021 12:37:47 +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 13LCbgpT013643 for ; Wed, 21 Apr 2021 08:37:42 -0400 Received: by smtp.corp.redhat.com (Postfix) id 30B4119D80; Wed, 21 Apr 2021 12:37:42 +0000 (UTC) Received: from antique-work.redhat.com (unknown [10.40.195.130]) by smtp.corp.redhat.com (Postfix) with ESMTP id A193B19D9B for ; Wed, 21 Apr 2021 12:37:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1619008863; 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=v0IIwN8CQTzkcuNlJivClT2zpKhxZLWTx4HP3ynqkxE=; b=FlGLZRpS475HH56Ug2+bYYDOUogyuJ+aNxsletZclG/59OdrYzYRmEKY0iTbRc6iMQw4ly UBDXxSjAHq+9PP3Q5sn3bJUJwa0yGsN57qFDKuIdr+mP4hk/KXtY3LjLrUVYq9ZnO8Ij7s 4avd+IfcWMhFDIsJ2yXnNwlYpf4pAVs= X-MC-Unique: GKCP4UflNZK_w4NRrj8Csg-1 From: Pavel Hrdina To: libvir-list@redhat.com Subject: [libvirt PATCH v3 3/8] meson: drop check for runtime binary dependencies Date: Wed, 21 Apr 2021 14:37:26 +0200 Message-Id: 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.84 on 10.5.11.23 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 837955de37..fc8fc4f252 100644 --- a/meson.build +++ b/meson.build @@ -926,24 +926,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 @@ -1706,54 +1691,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 ee3f9dab0a..8e1a42b119 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 b0cc63ed42..bf70083f2a 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 7efadc2197..c225f2ab6b 100644 --- a/src/storage/storage_util.c +++ b/src/storage/storage_util.c @@ -84,6 +84,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 3f49a469e5..b7a9808f6a 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.30.2 From nobody Fri May 17 08:39:14 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=1619008677; cv=none; d=zohomail.com; s=zohoarc; b=Gb/IsLqrfsdVUPGppE3bR59XeZGK+zn45oq4C26znhyusxMOHDng0eIwgXD3ALpQgF/UTq0GRBBdEt7BRl5WMNv3U7aWzMk/TuVGCV4M12AB9BP0OkvrVUoCm+hupbdhtjC1XQSZqNoIQaLS2dPnLDJcqdC0j6SCNGpIDRo2S6A= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1619008677; 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=wctmCLvw95IFdCZq93ByJOjiTKI6jJz+dHXCFppFvLo=; b=DvNUMbMpipoq1FsOX0rbl6gcVSCrhMhiNrmrHVmxroixqBX3AZ7tIDKX5dWA7oi9tnoyy7dI/Pn8qc3nmX4eHgbw1CisLFX/gyOGWW7hFmjq0YOldTttzlN7yTbu09LlI+MgN+iWmnUtbg1jLaqexwE3lMYbzb20OnXAetNEm/4= 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 1619008677749275.0250632093497; Wed, 21 Apr 2021 05:37:57 -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-10-Aepd16LjOa2JCc6oJ5x2fA-1; Wed, 21 Apr 2021 08:37:54 -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 10A9883DD32; Wed, 21 Apr 2021 12:37:48 +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 E644660916; Wed, 21 Apr 2021 12:37:47 +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 AFCBE1806D1C; Wed, 21 Apr 2021 12:37:47 +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 13LCbhSV013649 for ; Wed, 21 Apr 2021 08:37:43 -0400 Received: by smtp.corp.redhat.com (Postfix) id 1490E19D9B; Wed, 21 Apr 2021 12:37:43 +0000 (UTC) Received: from antique-work.redhat.com (unknown [10.40.195.130]) by smtp.corp.redhat.com (Postfix) with ESMTP id 857BE19D80 for ; Wed, 21 Apr 2021 12:37:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1619008676; 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=wctmCLvw95IFdCZq93ByJOjiTKI6jJz+dHXCFppFvLo=; b=IRBXTxJK00F2/5dbL+fLbRJjB8wrF6yotrtDkg7xsJL/ue0FOQCg4gFT7DMey20pStHpJf AxPYU5bk7Radw23XO0nsJbPUuVb8ry/CI07UG18A2AdFyl5vefdXzBZBdYNoBgNUiQKLcu TR81cSK3j9cjjIjEb+YPcZsGV44wEaE= X-MC-Unique: Aepd16LjOa2JCc6oJ5x2fA-1 From: Pavel Hrdina To: libvir-list@redhat.com Subject: [libvirt PATCH v3 4/8] meson: move iscsiadm check into storage_iscsi condition Date: Wed, 21 Apr 2021 14:37:27 +0200 Message-Id: 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 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 fc8fc4f252..8c71e803bf 100644 --- a/meson.build +++ b/meson.build @@ -927,7 +927,6 @@ endforeach optional_programs =3D [ 'augparse', 'flake8', - 'iscsiadm', 'pdwtags', ] =20 @@ -1802,11 +1801,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.30.2 From nobody Fri May 17 08:39:14 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=1619008683; cv=none; d=zohomail.com; s=zohoarc; b=jGzssyxq/+7RG6H2WXgoGgTkdiSUk1qofTza8hDNzKiUPVT0BGcXX8F5Xtv9La1UfJCmbTvEsQ0klCWqu5E1G2+SijbbVQWbUPI2CkuWpI6FBcd9cbRWApWWDbuM/ZzijVkr8qnbDe/oNrnFAPX7CvdKc+aRslvp76NOk4M5TFc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1619008683; 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=e/OoVwWHaGtv25LNCO929thdz35ryOLnkpug8uO8eWc=; b=HXofZ3Rmym575OCrpTmqYxum6e7Aw3sjqByNTxy71ZAlpmfBqZ6czSfwYO7VzF9X3GlkycUwCMpP+s4ywaWk6/SPZ6yN27YlgmTLnBAnCadHJNrSjnxrRu1SUTWsTX65winfJWgoJEqbUjflXMVxTBpZwCa0/VHVFdTvpNRBAS4= 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 1619008683086653.635925978863; Wed, 21 Apr 2021 05:38:03 -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-299-FekxYT6hPQyD7ACwGdSHZg-1; Wed, 21 Apr 2021 08:37:59 -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 2E5AA343B1; Wed, 21 Apr 2021 12:37:51 +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 B10C55DAA5; Wed, 21 Apr 2021 12:37:50 +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 771E944A5C; Wed, 21 Apr 2021 12:37:50 +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 13LCbhdO013657 for ; Wed, 21 Apr 2021 08:37:44 -0400 Received: by smtp.corp.redhat.com (Postfix) id EF22519D80; Wed, 21 Apr 2021 12:37:43 +0000 (UTC) Received: from antique-work.redhat.com (unknown [10.40.195.130]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6BA3519726 for ; Wed, 21 Apr 2021 12:37:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1619008682; 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=e/OoVwWHaGtv25LNCO929thdz35ryOLnkpug8uO8eWc=; b=H40ZHqgoiMVjamYi3XvKV50v8j32Byib9U78b/0rMCYQaFRcHMmvNSQu3T/nX6AMsP61vw Blk3EUNOcIlpNkh2IaQQrvCbByLd59iL/0vJxV+ijmqZmftuWIKy7DPE/j0Ds6r0r2Drre afBRgq4NqJUoUHX+K3/t+AjMI1sGud4= X-MC-Unique: FekxYT6hPQyD7ACwGdSHZg-1 From: Pavel Hrdina To: libvir-list@redhat.com Subject: [libvirt PATCH v3 5/8] meson: stop setting runtime binaries defines during compilation Date: Wed, 21 Apr 2021 14:37:28 +0200 Message-Id: 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.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" 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 --- 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 8c71e803bf..5d8eb7f95c 100644 --- a/meson.build +++ b/meson.build @@ -1074,9 +1074,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 @@ -1488,9 +1486,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') @@ -1779,18 +1774,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 @@ -1835,11 +1819,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 @@ -1847,10 +1828,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 @@ -1879,7 +1856,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 @@ -1902,11 +1878,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 @@ -1914,9 +1887,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 @@ -2030,7 +2000,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 f8e0ce5123..061138c8ec 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.30.2 From nobody Fri May 17 08:39:14 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=1619008681; cv=none; d=zohomail.com; s=zohoarc; b=EmY97UAqaMxpr4I2FVHGnEtPHgFyDFBs3L5B36R0YbYjZRfRX2a+x4okXK+JxZHCzgWlc+5hi3h7t2YAZCbXIddff6R5g99FrFHYJtkzqmvBvoyQa7VP2qGOIQqq9ScUT64AO6MlHiWzJ7EYD6Y0eY42r+gQGP+W6aHmmMmFK7g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1619008681; 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=EACQbbUR1t6T6sCTKa9vHT/uu7nS3zAqfi1e5Q0EJVk=; b=dEVR05j6tL5FHtuV3QNDCR69v+jJxbkYmhxhqcwMSEVZvhlU/Y5kJdMpxi2AXcC1nmRuHTPfrSBnDlJp35WlSfYIeHxqwCXuOtQQYfIoZUUM4Q+eTYDua4HGS8SWLaipzgrnCYl+0pgKqy3g+pF5tAOyr+j9EDtf5//iq2paYqU= 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 161900868167614.54155149091116; Wed, 21 Apr 2021 05:38: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-380-UE8GVk5ANfiN8dS1f9ecHg-1; Wed, 21 Apr 2021 08:37:57 -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 79DBA81A281; Wed, 21 Apr 2021 12:37:50 +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 597E119CB2; Wed, 21 Apr 2021 12:37:50 +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 221CC1806D21; Wed, 21 Apr 2021 12:37:50 +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 13LCbiFx013670 for ; Wed, 21 Apr 2021 08:37:44 -0400 Received: by smtp.corp.redhat.com (Postfix) id D3B1F19726; Wed, 21 Apr 2021 12:37:44 +0000 (UTC) Received: from antique-work.redhat.com (unknown [10.40.195.130]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4F22C19D80 for ; Wed, 21 Apr 2021 12:37:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1619008680; 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=EACQbbUR1t6T6sCTKa9vHT/uu7nS3zAqfi1e5Q0EJVk=; b=YarChjozkOBEZY+SJRLZ3wClJspnXrrh9pGEH1n2BDAa7Gie7NsbqqxgGnSPVFESFGB7rZ IyhUavLebYOUmTuKXUpvvRtn2QLp2ePJ2j2+UrLWprerDZ3DF57tvUnNIyH1F6+SWJwGJg Sb9KzvjuUA7HW30v39W1CG2DW9qR1Jo= X-MC-Unique: UE8GVk5ANfiN8dS1f9ecHg-1 From: Pavel Hrdina To: libvir-list@redhat.com Subject: [libvirt PATCH v3 6/8] meson: use runtime binaries to only resolve features with "auto" value Date: Wed, 21 Apr 2021 14:37:29 +0200 Message-Id: <85e7ba033d84d370e361bdac58a8db23d320e0ae.1619008487.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.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 --- meson.build | 102 ++++++++++++++++++++++++++++++++-------------------- 1 file changed, 63 insertions(+), 39 deletions(-) diff --git a/meson.build b/meson.build index 5d8eb7f95c..a7d402cd31 100644 --- a/meson.build +++ b/meson.build @@ -1072,12 +1072,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() @@ -1480,11 +1474,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() @@ -1740,8 +1740,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 @@ -1762,10 +1771,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 @@ -1787,14 +1796,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 @@ -1818,12 +1824,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 @@ -1851,9 +1860,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 @@ -1877,12 +1892,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 @@ -1997,8 +2015,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.30.2 From nobody Fri May 17 08:39:14 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=1619008750; cv=none; d=zohomail.com; s=zohoarc; b=FVnNMWyYmjke3+TaOBacHY1Z2e+QHbhWVa75N1wC6atWWuf6C5yiSjL3eTJh468tl0+KFHnzCpypmUfEfG/Xs204iFmAYDjulVysaMvTNV0M6h3BLYmgyDbV5dtwcgAHO8X4RG0obrNtW9pTRV6p4oRVqERng8lrDX30tjGPYcE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1619008750; 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=QB16Y4WOh/VdBPwSf4e5Y8Rb4X6ezCaB2U0itBwnLcI=; b=F5NkCNyGXu/ZFW4Zl4+s3ZQeEmWg7WhcHt1pZsBsiRgngT7FXJw7/PfIOSmd+oPBeB24IINLrN+KSkvOcsZGiqj89AzrV/sPUNhecp/jO6U7LNQr0u4iF60Em3se16r9si+iseC0eXFqSwVHdXMaHi/V+dvBVFzIcU1SDa3k18o= 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 1619008750450649.7387075239778; Wed, 21 Apr 2021 05:39: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-378-HCZZohB2PvuCPPXVBoHeMg-1; Wed, 21 Apr 2021 08:38:01 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 94D5F343A5; Wed, 21 Apr 2021 12:37: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 6A0C45C230; Wed, 21 Apr 2021 12:37:53 +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 2F82344A63; Wed, 21 Apr 2021 12:37:53 +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 13LCbjkZ013680 for ; Wed, 21 Apr 2021 08:37:45 -0400 Received: by smtp.corp.redhat.com (Postfix) id B928D1972B; Wed, 21 Apr 2021 12:37:45 +0000 (UTC) Received: from antique-work.redhat.com (unknown [10.40.195.130]) by smtp.corp.redhat.com (Postfix) with ESMTP id 35D8819D80 for ; Wed, 21 Apr 2021 12:37:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1619008749; 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=QB16Y4WOh/VdBPwSf4e5Y8Rb4X6ezCaB2U0itBwnLcI=; b=J+COeOesnrdPt36wyKld0xSdEr7w8b9XMfRgBasJGxqE75sp2UNawB3OynD45W+q8Hd24b U/nlCnmapd+4EN6LLzXxrLEfck1zx67bB93Jo26TzYLWxVZPoty6yraZhS5BVEzlWLQEcC EeZEXYT5qatFPtL4Nd6oWXnDK8dBaJA= X-MC-Unique: HCZZohB2PvuCPPXVBoHeMg-1 From: Pavel Hrdina To: libvir-list@redhat.com Subject: [libvirt PATCH v3 7/8] meson: optional_programs should be used only for building libvirt Date: Wed, 21 Apr 2021 14:37:30 +0200 Message-Id: <53c1ab0d39bc2d79426ccd29d98e0faf616ac1af.1619008487.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.16 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 --- meson.build | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/meson.build b/meson.build index a7d402cd31..d93f2ff469 100644 --- a/meson.build +++ b/meson.build @@ -922,7 +922,7 @@ foreach item : required_programs_groups endforeach =20 =20 -# optional programs +# optional programs used while building libvirt =20 optional_programs =3D [ 'augparse', @@ -933,14 +933,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.30.2 From nobody Fri May 17 08:39:14 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=1619008843; cv=none; d=zohomail.com; s=zohoarc; b=jVh9GYRJgic7ixEbJOTyX4G0W9HiUFxkBTYhL1jce1woUMdx+r0o3wqhjSP+b7qma+3/9xTSxGWAXfWIRFq70tKpRk6zAnn+I0UOcMnYMtLa4LR2ad4lt1JfbHwkSyrfzU6CGqNn/9Snui6LxQvrszaS3LR06T5a9u2+IUywGV0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1619008843; 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=opEwkQjOb1X/aN/IaPRaxPtnzimeR9WNLetP6VUOPgk=; b=OJ6kJK1w/oYxKXEXWdqwH8mjbzMgYlhwVcDE4uK4u3aI9LuG9VQXPbiEHJSu7HOy6jOGSntpnxi6LlN5RN2cSwnwPTrqMXoeIEirK97sr9Iirm0V+tFdWOcifcVPnkQKec3hgLjqMYWxFkn58BFqbeqHnL/5gt5oTJCl070UrsA= 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 1619008843521999.7697838869814; Wed, 21 Apr 2021 05:40:43 -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-278-ug9osAYIODCycfUT4CMqYQ-1; Wed, 21 Apr 2021 08:37:57 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 4A8B710054F6; Wed, 21 Apr 2021 12:37:51 +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 2DB7D6362B; Wed, 21 Apr 2021 12:37:51 +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 EEA911806D25; Wed, 21 Apr 2021 12:37:50 +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 13LCbkCX013687 for ; Wed, 21 Apr 2021 08:37:46 -0400 Received: by smtp.corp.redhat.com (Postfix) id 99D221972B; Wed, 21 Apr 2021 12:37:46 +0000 (UTC) Received: from antique-work.redhat.com (unknown [10.40.195.130]) by smtp.corp.redhat.com (Postfix) with ESMTP id 17AEC19D80 for ; Wed, 21 Apr 2021 12:37:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1619008842; 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=opEwkQjOb1X/aN/IaPRaxPtnzimeR9WNLetP6VUOPgk=; b=MNoRUwe7tcfqh5hN1D3JEgH6setDFZjMU5/q8GFstKadk6JTh87Sbr+NhHYIsCJn/pU5sJ LVWtI0upsF+JmIb1wK8GcPlIUhYtaSUXNjaPfspD+esOMjG3U2w51htMviaTS5Q7y/FSTH SzygC9F4Trqh3U/W3RWterYyKO1/iOc= X-MC-Unique: ug9osAYIODCycfUT4CMqYQ-1 From: Pavel Hrdina To: libvir-list@redhat.com Subject: [libvirt PATCH v3 8/8] libvirt.spec: drop no longer required build dependencies Date: Wed, 21 Apr 2021 14:37:31 +0200 Message-Id: <65a786205f460cf89722919f72b44f08a19bbc36.1619008487.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.15 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 f9af330186..7c661b6a82 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -299,10 +299,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 @@ -311,13 +307,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 @@ -341,15 +331,6 @@ BuildRequires: librbd1-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 @@ -374,21 +355,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.30.2