From nobody Tue Feb 10 19:47:43 2026 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=1622536927; cv=none; d=zohomail.com; s=zohoarc; b=STnu2GQOImWoLYw7gY4nufEQVroBTg2R06CAc6/Z/N7za27HMLUx6xeFxVJrAXANARkNI+/ZJZSlx3F5Pto3KPrxRpdZncS8Yr4pntsp8eQP/0Q7+ZwCIHN0XqT56cF2HGgf6+Y0RBdzQdxLEMwT44A8vGLAgXiAIvPVF/Q8XVk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622536927; 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=EpM7GQwc9iL9zb/UfB2s0MEdrTHCY6xxi5syg4U9hQc=; b=UI6+qKG6sNWu8FVP/pyRAwXGdqapUYiiTViX1nsn+QWw74L0YNrsxabXqdpVPwAWuRUvz9IGIBDbaPCBWv8GiCmmJMzRlG/PNIHGMU18v9ghgG45sr5qBUXruQ70nS3WYAUrsaWOt4/oAnoKDiBHFWzLnjBlPbGSe6yDUel0Ad0= 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 1622536927316135.63568894579964; Tue, 1 Jun 2021 01:42:07 -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-384-g9RiW_G6OD2pPqoAjeOyJQ-1; Tue, 01 Jun 2021 04:38:38 -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 07E801019634; Tue, 1 Jun 2021 08:38:32 +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 D2B5B100763C; Tue, 1 Jun 2021 08:38:31 +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 9D9BE5535B; Tue, 1 Jun 2021 08:38:31 +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 1518cSWG026099 for ; Tue, 1 Jun 2021 04:38:28 -0400 Received: by smtp.corp.redhat.com (Postfix) id 690AF2C1B9; Tue, 1 Jun 2021 08:38:28 +0000 (UTC) Received: from harajuku.usersys.redhat.com (unknown [10.40.195.114]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C5E5FE2D4 for ; Tue, 1 Jun 2021 08:38:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1622536926; 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=EpM7GQwc9iL9zb/UfB2s0MEdrTHCY6xxi5syg4U9hQc=; b=ccUHpGfZ7shNmjjl3bSdDnIemikEnNpics5k9sGHco5/F+XnkeRWo6psA0mK9ed23mlWw4 Y2G7J45ygWIFt0BPyJODrmb8H7oYJtC1rkbnZCPLB+g01+1AWL1MZ8bd2eDPKB94mffOnI xUdKa5fdjq5QtEFIwmjwRQ76wmlxQkA= X-MC-Unique: g9RiW_G6OD2pPqoAjeOyJQ-1 From: Andrea Bolognani To: libvir-list@redhat.com Subject: [libvirt PATCH 17/26] meson: Rewrite libacl check Date: Tue, 1 Jun 2021 10:37:48 +0200 Message-Id: <20210601083757.10194-18-abologna@redhat.com> In-Reply-To: <20210601083757.10194-1-abologna@redhat.com> References: <20210601083757.10194-1-abologna@redhat.com> 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.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" libacl is Linux-only, so we don't need to explicitly check for either the target platform or header availability, and we can simply rely on cc.find_library() instead. The corresponding preprocessor define is renamed to more accurately reflect the nature of the check. Signed-off-by: Andrea Bolognani --- meson.build | 8 +++----- src/qemu/qemu_namespace.c | 2 +- src/util/virfile.c | 8 ++++---- 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/meson.build b/meson.build index 0b2e3e062e..301cebab5c 100644 --- a/meson.build +++ b/meson.build @@ -844,11 +844,9 @@ endforeach =20 # generic build dependencies =20 -if host_machine.system() =3D=3D 'linux' and cc.has_header('sys/acl.h') - acl_dep =3D cc.find_library('acl', required: false) - conf.set('WITH_SYS_ACL_H', 1) -else - acl_dep =3D dependency('', required: false) +acl_dep =3D cc.find_library('acl', required: false) +if acl_dep.found() + conf.set('WITH_LIBACL', 1) endif =20 apparmor_dep =3D dependency('libapparmor', required: get_option('apparmor'= )) diff --git a/src/qemu/qemu_namespace.c b/src/qemu/qemu_namespace.c index 6a97863d92..98495e8ef8 100644 --- a/src/qemu/qemu_namespace.c +++ b/src/qemu/qemu_namespace.c @@ -852,7 +852,7 @@ qemuDomainNamespaceAvailable(qemuDomainNamespace ns G_G= NUC_UNUSED) =20 switch (ns) { case QEMU_DOMAIN_NS_MOUNT: -# if !defined(WITH_SYS_ACL_H) || !defined(WITH_SELINUX) +# if !defined(WITH_LIBACL) || !defined(WITH_SELINUX) /* We can't create the exact copy of paths if either of * these is not available. */ return false; diff --git a/src/util/virfile.c b/src/util/virfile.c index 03a7725dd3..cd63eceb16 100644 --- a/src/util/virfile.c +++ b/src/util/virfile.c @@ -56,7 +56,7 @@ #if WITH_SYS_SYSCALL_H # include #endif -#if WITH_SYS_ACL_H +#if WITH_LIBACL # include #endif #include @@ -3752,7 +3752,7 @@ virFileMoveMount(const char *src G_GNUC_UNUSED, #endif /* !defined(__linux__) || !defined(WITH_SYS_MOUNT_H) */ =20 =20 -#if defined(WITH_SYS_ACL_H) +#if defined(WITH_LIBACL) int virFileGetACLs(const char *file, void **acl) @@ -3782,7 +3782,7 @@ virFileFreeACLs(void **acl) *acl =3D NULL; } =20 -#else /* !defined(WITH_SYS_ACL_H) */ +#else /* !defined(WITH_LIBACL) */ =20 int virFileGetACLs(const char *file G_GNUC_UNUSED, @@ -3808,7 +3808,7 @@ virFileFreeACLs(void **acl) *acl =3D NULL; } =20 -#endif /* !defined(WITH_SYS_ACL_H) */ +#endif /* !defined(WITH_LIBACL) */ =20 int virFileCopyACLs(const char *src, --=20 2.31.1