From nobody Mon Sep 16 20:16:42 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=1682911266; cv=none; d=zohomail.com; s=zohoarc; b=b1qMtUa7fckOzNy0a7vnyLeW4prlCp7C1Cztpd9X7XC5keuA7B/5Yc9toy3RkE7ILaQGPU28Lt5V+FTpX3jqr0tnAuVqTNCDzizCZqtwHArJRLtzeEar/90Y31+OuCRA44nIN+LXubSEgQAoTh43DuydKdtEbe8KxPdN0ajLFmQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1682911266; 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=mnUgnfy5h+dW+wQJmbueqL1MTvvk+6gkpB19gmAmWyE=; b=jLEusjcMyJJND4OMfwriYPYHpyeIWS0gwYEmjf7fzqCoUkziJi8/E+b0J4y1Lxbqg3zd7uAXeK4dvgCDpVCgS621fvks9gpoGEnSpA0S8LVG+xQRhXsuF2Thhkua0puDjo20yzsGtyfpvaT2k8dki9j8DiC01Q1JI6YEWa0a638= 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) 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 1682911266642796.3015611825749; Sun, 30 Apr 2023 20:21:06 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-262-weDNwqnGNnmmRrzpYI6OBQ-1; Sun, 30 Apr 2023 23:20:15 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 6C6321818218; Mon, 1 May 2023 03:20:10 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 586FE63F42; Mon, 1 May 2023 03:20:10 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 394EB1946A6E; Mon, 1 May 2023 03:20:08 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id CA6EA19465A2 for ; Mon, 1 May 2023 03:20:05 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id A0A4F4750C0; Mon, 1 May 2023 03:19:45 +0000 (UTC) Received: from vhost3.router.laine.org (unknown [10.22.8.105]) by smtp.corp.redhat.com (Postfix) with ESMTP id 87B5B40F169 for ; Mon, 1 May 2023 03:19:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1682911265; 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=mnUgnfy5h+dW+wQJmbueqL1MTvvk+6gkpB19gmAmWyE=; b=G1mKk9AaWUQRwGJngt37aUbqdCLJ5j/Vo3n2ziJNrZIu3WJYdnE/ZdukDuLOziAqixOdNa HOuhD3cBOCnkc1uL2J10fdvxwqinzrLOLjixpOSa5noJn2SdT3RdU8IF72q+u8iqXaoVI9 ITJFZBvhOvhFmzW+WPUICIZZd54BE+g= X-MC-Unique: weDNwqnGNnmmRrzpYI6OBQ-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Laine Stump To: libvir-list@redhat.com Subject: [libvirt PATCH 10/28] network: add (empty) network.conf file to distribution files Date: Sun, 30 Apr 2023 23:19:25 -0400 Message-Id: <20230501031943.288145-11-laine@redhat.com> In-Reply-To: <20230501031943.288145-1-laine@redhat.com> References: <20230501031943.288145-1-laine@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.5 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1682911267491100007 Content-Type: text/plain; charset="utf-8"; x-default="true" Signed-off-by: Laine Stump Reviewed-by: Daniel P. Berrang=C3=A9 --- libvirt.spec.in | 3 ++ src/network/libvirtd_network.aug | 36 ++++++++++++++++++++++++ src/network/meson.build | 11 ++++++++ src/network/network.conf | 3 ++ src/network/test_libvirtd_network.aug.in | 2 ++ 5 files changed, 55 insertions(+) create mode 100644 src/network/libvirtd_network.aug create mode 100644 src/network/network.conf create mode 100644 src/network/test_libvirtd_network.aug.in diff --git a/libvirt.spec.in b/libvirt.spec.in index dae9c87aa4..ba73efb0b7 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -1979,6 +1979,9 @@ exit 0 %config(noreplace) %{_sysconfdir}/libvirt/virtnetworkd.conf %{_datadir}/augeas/lenses/virtnetworkd.aug %{_datadir}/augeas/lenses/tests/test_virtnetworkd.aug +%config(noreplace) %{_sysconfdir}/libvirt/network.conf +%{_datadir}/augeas/lenses/libvirtd_network.aug +%{_datadir}/augeas/lenses/tests/test_libvirtd_network.aug %{_unitdir}/virtnetworkd.service %{_unitdir}/virtnetworkd.socket %{_unitdir}/virtnetworkd-ro.socket diff --git a/src/network/libvirtd_network.aug b/src/network/libvirtd_networ= k.aug new file mode 100644 index 0000000000..ae153d96a1 --- /dev/null +++ b/src/network/libvirtd_network.aug @@ -0,0 +1,36 @@ +(* /etc/libvirt/network.conf *) + +module Libvirtd_network =3D + autoload xfm + + let eol =3D del /[ \t]*\n/ "\n" + let value_sep =3D del /[ \t]*=3D[ \t]*/ " =3D " + let indent =3D del /[ \t]*/ "" + + let array_sep =3D del /,[ \t\n]*/ ", " + let array_start =3D del /\[[ \t\n]*/ "[ " + let array_end =3D del /\]/ "]" + + let str_val =3D del /\"/ "\"" . store /[^\"]*/ . del /\"/ "\"" + let bool_val =3D store /0|1/ + let int_val =3D store /[0-9]+/ + let str_array_element =3D [ seq "el" . str_val ] . del /[ \t\n]*/ "" + let str_array_val =3D counter "el" . array_start . ( str_array_element = . ( array_sep . str_array_element ) * ) ? . array_end + + let str_entry (kw:string) =3D [ key kw . value_sep . str_val ] + let bool_entry (kw:string) =3D [ key kw . value_sep . bool_val ] + let int_entry (kw:string) =3D [ key kw . value_sep . int_val ] + let str_array_entry (kw:string) =3D [ key kw . value_sep . str_array_va= l ] + + (* Each entry in the config is one of the following *) + let comment =3D [ label "#comment" . del /#[ \t]*/ "# " . store /([^ \= t\n][^\n]*)?/ . del /\n/ "\n" ] + let empty =3D [ label "#empty" . eol ] + + let record =3D indent . eol + + let lns =3D ( record | comment | empty ) * + + let filter =3D incl "/etc/libvirt/network.conf" + . Util.stdexcl + + let xfm =3D transform lns filter diff --git a/src/network/meson.build b/src/network/meson.build index 0888d1beac..9a00b5d969 100644 --- a/src/network/meson.build +++ b/src/network/meson.build @@ -48,6 +48,17 @@ if conf.has('WITH_NETWORK') ], } =20 + virt_conf_files +=3D files('network.conf') + virt_aug_files +=3D files('libvirtd_network.aug') + virt_test_aug_files +=3D { + 'name': 'test_libvirtd_network.aug', + 'aug': files('test_libvirtd_network.aug.in'), + 'conf': files('network.conf'), + 'test_name': 'libvirtd_network', + 'test_srcdir': meson.current_source_dir(), + 'test_builddir': meson.current_build_dir(), + } + virt_daemon_confs +=3D { 'name': 'virtnetworkd', } diff --git a/src/network/network.conf b/src/network/network.conf new file mode 100644 index 0000000000..5c84003f6d --- /dev/null +++ b/src/network/network.conf @@ -0,0 +1,3 @@ +# Master configuration file for the network driver. +# All settings described here are optional - if omitted, sensible +# defaults are used. diff --git a/src/network/test_libvirtd_network.aug.in b/src/network/test_li= bvirtd_network.aug.in new file mode 100644 index 0000000000..ffdca520ce --- /dev/null +++ b/src/network/test_libvirtd_network.aug.in @@ -0,0 +1,2 @@ +module Test_libvirtd_network =3D + @CONFIG@ --=20 2.39.2