From nobody Sun Feb 8 14:41:50 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) client-ip=207.211.31.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 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=1594893784; cv=none; d=zohomail.com; s=zohoarc; b=ESozOcIwRH2YjExBFp+Jn5K218HOP9OPQRUm6EWGzn5CtgIpF/EO1uM76IUoczwdau2dYOUu9E0TxwnwQ1Pc8Kn1PYz2DnZ4767mv4elhjqsm2nVXK+gXhwNCZKLB1Qun64oZmgEUC3fsog79D8GDSUWWDGwxYnj9HO0kkW+k6w= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1594893784; 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=oT8JCfIj9iOh/yNAvKk+A0Eq9uVgj1QB7BwFtNoX2VE=; b=KFt2sLl+PwlADr/2gek3+MBpQfNkIizh+cNJhG22LbXOUzslf2Z9hL1bqAH4bfMHZkTtKOXrdUCQAdw5fmoAO/7nca32DY4jgqF46GK4Z9t6JB4dMKqLHcEnvwQm3J1Au8LbUUmNu8Hx8O+HF/BYEH9IKTV+Dl/1xW16M75ShzA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by mx.zohomail.com with SMTPS id 1594893784085216.8198280650181; Thu, 16 Jul 2020 03:03: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-349-GRBo5gp8NZqUhe1h-a2e1g-1; Thu, 16 Jul 2020 06:03:01 -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 B878019057B8; Thu, 16 Jul 2020 10:02:28 +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 6EB817951E; Thu, 16 Jul 2020 10:02:28 +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 3724C1809563; Thu, 16 Jul 2020 10:02:28 +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 06GA2PSa016387 for ; Thu, 16 Jul 2020 06:02:25 -0400 Received: by smtp.corp.redhat.com (Postfix) id 13FED2B6DB; Thu, 16 Jul 2020 10:02:25 +0000 (UTC) Received: from antique-work.redhat.com (unknown [10.40.194.85]) by smtp.corp.redhat.com (Postfix) with ESMTP id 816162DE6B for ; Thu, 16 Jul 2020 10:02:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1594893783; 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=oT8JCfIj9iOh/yNAvKk+A0Eq9uVgj1QB7BwFtNoX2VE=; b=gO+6uml3zuBYVvZFem+LRLqwyBarvJY5tuzPqM4BxDybpNl2012Cc9oMt4EvGQjtNvKNcF L8rMFTsg++GRtPX1OHymEK7MYAN8uYXpOLEReZXFwejjnR/D0cCvK/ZvF+JZX51pAMtQ1W SAaR8Lu5qIyoBzXFKAgQGOisMk//ErM= X-MC-Unique: GRBo5gp8NZqUhe1h-a2e1g-1 From: Pavel Hrdina To: libvir-list@redhat.com Subject: [libvirt PATCH 067/351] meson: add polkit build option Date: Thu, 16 Jul 2020 11:55:03 +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 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Signed-off-by: Pavel Hrdina --- configure.ac | 3 --- m4/virt-polkit.m4 | 62 ----------------------------------------------- meson.build | 13 ++++++++++ meson_options.txt | 1 + 4 files changed, 14 insertions(+), 65 deletions(-) delete mode 100644 m4/virt-polkit.m4 diff --git a/configure.ac b/configure.ac index 49e6cb6e84e..359bfe4fa54 100644 --- a/configure.ac +++ b/configure.ac @@ -110,7 +110,6 @@ fi =20 LIBVIRT_ARG_NSS LIBVIRT_ARG_PM_UTILS -LIBVIRT_ARG_POLKIT LIBVIRT_ARG_SANLOCK LIBVIRT_ARG_SASL LIBVIRT_ARG_SELINUX @@ -121,7 +120,6 @@ LIBVIRT_ARG_YAJL =20 LIBVIRT_CHECK_NWFILTER LIBVIRT_CHECK_PM_UTILS -LIBVIRT_CHECK_POLKIT LIBVIRT_CHECK_PTHREAD LIBVIRT_CHECK_SANLOCK LIBVIRT_CHECK_SASL @@ -412,7 +410,6 @@ AC_MSG_NOTICE([]) LIBVIRT_RESULT_LIBXL LIBVIRT_RESULT_NSS LIBVIRT_RESULT_PM_UTILS -LIBVIRT_RESULT_POLKIT LIBVIRT_RESULT_RBD LIBVIRT_RESULT_SANLOCK LIBVIRT_RESULT_SASL diff --git a/m4/virt-polkit.m4 b/m4/virt-polkit.m4 deleted file mode 100644 index 06da9e4ba6f..00000000000 --- a/m4/virt-polkit.m4 +++ /dev/null @@ -1,62 +0,0 @@ -dnl The polkit library -dnl -dnl Copyright (C) 2016 Red Hat, Inc. -dnl -dnl This library is free software; you can redistribute it and/or -dnl modify it under the terms of the GNU Lesser General Public -dnl License as published by the Free Software Foundation; either -dnl version 2.1 of the License, or (at your option) any later version. -dnl -dnl This library is distributed in the hope that it will be useful, -dnl but WITHOUT ANY WARRANTY; without even the implied warranty of -dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -dnl Lesser General Public License for more details. -dnl -dnl You should have received a copy of the GNU Lesser General Public -dnl License along with this library. If not, see -dnl . -dnl - -AC_DEFUN([LIBVIRT_ARG_POLKIT], [ - LIBVIRT_ARG_WITH([POLKIT], [use PolicyKit for UNIX socket access checks], - [check]) -]) - -AC_DEFUN([LIBVIRT_CHECK_POLKIT], [ - AC_REQUIRE([LIBVIRT_CHECK_DBUS]) - - if test "x$with_win" =3D "xyes"; then - with_polkit=3Dno - fi - - if test "x$with_polkit" =3D "xcheck"; then - dnl For --with-polkit=3Dcheck, also require the pkcheck binary, even - dnl though we talk to polkit directly over D-Bus. - AC_PATH_PROG([PKCHECK_PATH], [pkcheck], [], [$LIBVIRT_SBIN_PATH]) - if test "x$PKCHECK_PATH" =3D "x" ; then - with_polkit=3D"no" - fi - fi - - if test "x$with_polkit" =3D "xyes" || test "x$with_polkit" =3D "xcheck";= then - dnl For --with-polkit=3Dyes, all we need is D-Bus. - if test "x$with_dbus" =3D "xyes" ; then - AC_DEFINE_UNQUOTED([WITH_POLKIT], 1, - [use PolicyKit for UNIX socket access checks]) - with_polkit=3D"yes" - else - if test "x$with_polkit" =3D "xcheck" ; then - with_polkit=3Dno - else - AC_MSG_ERROR( - [You must install dbus to compile libvirt with polkit-1]) - fi - fi - fi - - AM_CONDITIONAL([WITH_POLKIT], [test "x$with_polkit" =3D "xyes"]) -]) - -AC_DEFUN([LIBVIRT_RESULT_POLKIT], [ - LIBVIRT_RESULT([polkit], [$with_polkit]) -]) diff --git a/meson.build b/meson.build index 17116af59da..e6dc0aa8717 100644 --- a/meson.build +++ b/meson.build @@ -1226,6 +1226,12 @@ parallels_sdk_dep =3D dependency('parallels-sdk', ve= rsion: '>=3D' + parallels_sdk_ve pciaccess_version =3D '0.10.0' pciaccess_dep =3D dependency('pciaccess', version: '>=3D' + pciaccess_vers= ion, required: get_option('pciaccess')) =20 +if not get_option('polkit').disabled() and host_machine.system() !=3D 'win= dows' + pkcheck_prog =3D find_program('pkcheck', required: false, dirs: libvirt_= sbin_path) +else + pkcheck_prog =3D dependency('', required: false) +endif + # readline 7.0 is the first version which includes pkg-config support readline_version =3D '7.0' readline_dep =3D dependency('readline', version: '>=3D' + readline_version= , required: false) @@ -1333,6 +1339,12 @@ if conf.has('WITH_MACVTAP') and not conf.has('HAVE_L= IBNL') error('libnl3-devel is required for macvtap support') endif =20 +if (pkcheck_prog.found() or get_option('polkit').enabled()) and dbus_dep.f= ound() + conf.set('WITH_POLKIT', 1) +elif get_option('polkit').enabled() + error('You must install dbus to compile libvirt with polkit-1') +endif + =20 # define top include directory =20 @@ -1382,6 +1394,7 @@ libs_summary =3D { 'numaclt': numactl_dep.found(), 'openwsman': openwsman_dep.found(), 'pciaccess': pciaccess_dep.found(), + 'polkit': conf.has('WITH_POLKIT'), 'readline': readline_dep.found(), } summary(libs_summary, section: 'Libraries', bool_yn: true) diff --git a/meson_options.txt b/meson_options.txt index 991245e0841..3dfe4ca0166 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -33,4 +33,5 @@ option('nls', type: 'feature', value: 'auto', description= : 'nls support') option('numactl', type: 'feature', value: 'auto', description: 'numactl su= pport') option('openwsman', type: 'feature', value: 'auto', description: 'openwsma= n support') option('pciaccess', type: 'feature', value: 'auto', description: 'pciacces= s support') +option('polkit', type: 'feature', value: 'auto', description: 'use PolicyK= it for UNIX socket access checks') option('readline', type: 'feature', value: 'auto', description: 'readline = support') --=20 2.26.2