From nobody Sun Feb 8 12:18:56 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 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=1565277217; cv=none; d=zoho.com; s=zohoarc; b=dXixwYsuwy/GwUa02ENWfjJnG3rM+7yoNyHGBB4gD8btvaJDybgAJj0Op/U9JLRFg/oh6ut/OlmAuaFwo0DSnpQILu7P78M/BrmiYDMWGwhOZjmJb29E4SlJL7qMSOYopYtVojPDl1pIFSt2Y6faIV6nPtd6y91ada4/yL01XKI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1565277217; h=Content-Type:Content-Transfer-Encoding:Cc: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:ARC-Authentication-Results; bh=zrFwF0VES6zWOXQT8GI3HqR/2S/FoApBul1j8HzRme0=; b=O+EVO4zUgPjy0fWYpDrmO1g6QceSjqXrM02FDtb1ACprooESvb1rIyWEXJ4ZHZk1YbIcUiqYtECZJIFjPRfff5a6pvgr3puP1qwTUtDYlumoccql+5pusZwSde73vG+HAQZj/3n/W09CKbN2FpOJS4IyrvWTCO84imvi0ynp7DQ= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1565277217624147.75524867897468; Thu, 8 Aug 2019 08:13:37 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id B3AE719D381; Thu, 8 Aug 2019 15:13:35 +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 8448C5EE1D; Thu, 8 Aug 2019 15:13:35 +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 42D111800B74; Thu, 8 Aug 2019 15:13:35 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x78FBGqS027419 for ; Thu, 8 Aug 2019 11:11:16 -0400 Received: by smtp.corp.redhat.com (Postfix) id 3E6CC10016F3; Thu, 8 Aug 2019 15:11:16 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-112-28.ams2.redhat.com [10.36.112.28]) by smtp.corp.redhat.com (Postfix) with ESMTP id 41999100194E; Thu, 8 Aug 2019 15:11:14 +0000 (UTC) From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Date: Thu, 8 Aug 2019 16:10:14 +0100 Message-Id: <20190808151044.11385-13-berrange@redhat.com> In-Reply-To: <20190808151044.11385-1-berrange@redhat.com> References: <20190808151044.11385-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com Cc: Andrea Bolognani Subject: [libvirt] [PATCH v4 12/42] remote: conditionalize IP socket config in augeas definitions 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: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Thu, 08 Aug 2019 15:13:36 +0000 (UTC) Prepare for reusing libvirtd augeas defintions with other daemons by making the config parameters for IP sockets conditionally defined by the make rules. Reviewed-by: Andrea Bolognani Signed-off-by: Daniel P. Berrang=C3=A9 --- .gitignore | 1 + src/remote/Makefile.inc.am | 21 ++++++++++++++-- src/remote/{libvirtd.aug =3D> libvirtd.aug.in} | 26 +++++++++++++------- src/remote/test_libvirtd.aug.in | 12 ++++++--- 4 files changed, 46 insertions(+), 14 deletions(-) rename src/remote/{libvirtd.aug =3D> libvirtd.aug.in} (89%) diff --git a/.gitignore b/.gitignore index 7d24dc3f5a..35dc2c8bec 100644 --- a/.gitignore +++ b/.gitignore @@ -158,6 +158,7 @@ /src/remote/*_client_bodies.h /src/remote/*_protocol.[ch] /src/remote/*_stubs.h +/src/remote/libvirtd.aug /src/remote/libvirtd.conf /src/remote/test_libvirtd.aug /src/rpc/virkeepaliveprotocol.[ch] diff --git a/src/remote/Makefile.inc.am b/src/remote/Makefile.inc.am index d7e614c476..314b90885f 100644 --- a/src/remote/Makefile.inc.am +++ b/src/remote/Makefile.inc.am @@ -75,7 +75,7 @@ EXTRA_DIST +=3D \ $(REMOTE_DRIVER_SOURCES) \ $(LIBVIRTD_SOURCES) \ remote/test_libvirtd.aug.in \ - remote/libvirtd.aug \ + remote/libvirtd.aug.in \ remote/libvirtd.conf.in \ remote/libvirtd.policy \ remote/libvirtd.rules \ @@ -133,6 +133,8 @@ augeastest_DATA +=3D remote/test_libvirtd.aug =20 nodist_conf_DATA +=3D remote/libvirtd.conf =20 +CLEANFILES +=3D remote/libvirtd.aug + man8_MANS +=3D libvirtd.8 =20 libvirtd_SOURCES =3D $(LIBVIRTD_SOURCES) @@ -197,9 +199,24 @@ install-data-remote: uninstall-data-remote: rmdir "$(DESTDIR)$(localstatedir)/log/libvirt" ||: =20 +remote/libvirtd.aug: remote/libvirtd.aug.in + $(AM_V_GEN)$(SED) \ + -e '/[@]CUT_ENABLE_IP[@]/d' \ + -e '/[@]END[@]/d' \ + -e 's|[@]DAEMON_NAME[@]|libvirtd|' \ + -e 's|[@]DAEMON_NAME_UC[@]|Libvirtd|' \ + $< > $@ + remote/test_libvirtd.aug: remote/test_libvirtd.aug.in \ remote/libvirtd.conf $(AUG_GENTEST) - $(AM_V_GEN)$(AUG_GENTEST) remote/libvirtd.conf $< > $@ + $(AM_V_GEN)$(AUG_GENTEST) remote/libvirtd.conf \ + $(srcdir)/remote/test_libvirtd.aug.in | \ + $(SED) \ + -e '/[@]CUT_ENABLE_IP[@]/d' \ + -e '/[@]END[@]/d' \ + -e 's|[@]DAEMON_NAME[@]|libvirtd|' \ + -e 's|[@]DAEMON_NAME_UC[@]|Libvirtd|' \ + > $@ || rm -f $@ =20 if WITH_SYSCTL # Use $(prefix)/lib rather than $(libdir), since man sysctl.d insists on diff --git a/src/remote/libvirtd.aug b/src/remote/libvirtd.aug.in similarity index 89% rename from src/remote/libvirtd.aug rename to src/remote/libvirtd.aug.in index 0188c23dd7..eec3433f29 100644 --- a/src/remote/libvirtd.aug +++ b/src/remote/libvirtd.aug.in @@ -1,6 +1,6 @@ -(* /etc/libvirt/libvirtd.conf *) +(* /etc/libvirt/@DAEMON_NAME@.conf *) =20 -module Libvirtd =3D +module @DAEMON_NAME_UC@ =3D autoload xfm =20 let eol =3D del /[ \t]*\n/ "\n" @@ -24,11 +24,13 @@ module Libvirtd =3D =20 =20 (* Config entry grouped by function - same order as example config *) +@CUT_ENABLE_IP@ let network_entry =3D bool_entry "listen_tls" | bool_entry "listen_tcp" | str_entry "tls_port" | str_entry "tcp_port" | str_entry "listen_addr" +@END@ =20 let sock_acl_entry =3D str_entry "unix_sock_group" | str_entry "unix_sock_ro_perms" @@ -38,6 +40,7 @@ module Libvirtd =3D =20 let authentication_entry =3D str_entry "auth_unix_ro" | str_entry "auth_unix_rw" +@CUT_ENABLE_IP@ | str_entry "auth_tcp" | str_entry "auth_tls" =20 @@ -46,12 +49,14 @@ module Libvirtd =3D | str_entry "ca_file" | str_entry "crl_file" =20 - let authorization_entry =3D bool_entry "tls_no_verify_certificate" + let tls_authorization_entry =3D bool_entry "tls_no_verify_certificate" | bool_entry "tls_no_sanity_certificate" | str_array_entry "tls_allowed_dn_list" - | str_array_entry "sasl_allowed_username_list" - | str_array_entry "access_drivers" | str_entry "tls_priority" +@END@ + + let misc_authorization_entry =3D str_array_entry "sasl_allowed_username= _list" + | str_array_entry "access_drivers" =20 let processing_entry =3D int_entry "min_workers" | int_entry "max_workers" @@ -87,11 +92,14 @@ module Libvirtd =3D | int_entry "ovs_timeout" =20 (* Each enty in the config is one of the following three ... *) - let entry =3D network_entry - | sock_acl_entry + let entry =3D sock_acl_entry | authentication_entry +@CUT_ENABLE_IP@ + | network_entry | certificate_entry - | authorization_entry + | tls_authorization_entry +@END@ + | misc_authorization_entry | processing_entry | admin_processing_entry | logging_entry @@ -106,7 +114,7 @@ module Libvirtd =3D =20 let lns =3D ( record | comment | empty ) * =20 - let filter =3D incl "/etc/libvirt/libvirtd.conf" + let filter =3D incl "/etc/libvirt/@DAEMON_NAME@.conf" . Util.stdexcl =20 let xfm =3D transform lns filter diff --git a/src/remote/test_libvirtd.aug.in b/src/remote/test_libvirtd.aug= .in index d768b30b55..2fd809af4a 100644 --- a/src/remote/test_libvirtd.aug.in +++ b/src/remote/test_libvirtd.aug.in @@ -1,12 +1,14 @@ -module Test_libvirtd =3D +module Test_@DAEMON_NAME@ =3D @CONFIG@ =20 - test Libvirtd.lns get conf =3D + test @DAEMON_NAME_UC@.lns get conf =3D +@CUT_ENABLE_IP@ { "listen_tls" =3D "0" } { "listen_tcp" =3D "1" } { "tls_port" =3D "16514" } { "tcp_port" =3D "16509" } { "listen_addr" =3D "192.168.0.1" } +@END@ { "unix_sock_group" =3D "libvirt" } { "unix_sock_ro_perms" =3D "0777" } { "unix_sock_rw_perms" =3D "0770" } @@ -14,11 +16,14 @@ module Test_libvirtd =3D { "unix_sock_dir" =3D "/var/run/libvirt" } { "auth_unix_ro" =3D "none" } { "auth_unix_rw" =3D "none" } +@CUT_ENABLE_IP@ { "auth_tcp" =3D "sasl" } { "auth_tls" =3D "none" } +@END@ { "access_drivers" { "1" =3D "polkit" } } +@CUT_ENABLE_IP@ { "key_file" =3D "/etc/pki/libvirt/private/serverkey.pem" } { "cert_file" =3D "/etc/pki/libvirt/servercert.pem" } { "ca_file" =3D "/etc/pki/CA/cacert.pem" } @@ -30,6 +35,7 @@ module Test_libvirtd =3D { "2" =3D "DN2"} } { "tls_priority" =3D "NORMAL" } +@END@ { "sasl_allowed_username_list" { "1" =3D "joe@EXAMPLE.COM" } { "2" =3D "fred@EXAMPLE.COM" } @@ -48,7 +54,7 @@ module Test_libvirtd =3D { "admin_max_client_requests" =3D "5" } { "log_level" =3D "3" } { "log_filters" =3D "1:qemu 1:libvirt 4:object 4:json 4:event 1:ut= il" } - { "log_outputs" =3D "3:syslog:libvirtd" } + { "log_outputs" =3D "3:syslog:@DAEMON_NAME@" } { "audit_level" =3D "2" } { "audit_logging" =3D "1" } { "host_uuid" =3D "00000000-0000-0000-0000-000000000000" } --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list