Signed-off-by: Laine Stump <laine(a)redhat.com>
---
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_network.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 =
+ autoload xfm
+
+ let eol = del /[ \t]*\n/ "\n"
+ let value_sep = del /[ \t]*=[ \t]*/ " = "
+ let indent = del /[ \t]*/ ""
+
+ let array_sep = del /,[ \t\n]*/ ", "
+ let array_start = del /\[[ \t\n]*/ "[ "
+ let array_end = del /\]/ "]"
+
+ let str_val = del /\"/ "\"" . store /[^\"]*/ . del /\"/
"\""
+ let bool_val = store /0|1/
+ let int_val = store /[0-9]+/
+ let str_array_element = [ seq "el" . str_val ] . del /[ \t\n]*/
""
+ let str_array_val = counter "el" . array_start . ( str_array_element . (
array_sep . str_array_element ) * ) ? . array_end
+
+ let str_entry (kw:string) = [ key kw . value_sep . str_val ]
+ let bool_entry (kw:string) = [ key kw . value_sep . bool_val ]
+ let int_entry (kw:string) = [ key kw . value_sep . int_val ]
+ let str_array_entry (kw:string) = [ key kw . value_sep . str_array_val ]
+
+ (* Each entry in the config is one of the following *)
+ let comment = [ label "#comment" . del /#[ \t]*/ "# " . store
/([^ \t\n][^\n]*)?/ . del /\n/ "\n" ]
+ let empty = [ label "#empty" . eol ]
+
+ let record = indent . eol
+
+ let lns = ( record | comment | empty ) *
+
+ let filter = incl "/etc/libvirt/network.conf"
+ . Util.stdexcl
+
+ let xfm = 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')
],
}
+ virt_conf_files += files('network.conf')
+ virt_aug_files += files('libvirtd_network.aug')
+ virt_test_aug_files += {
+ '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 += {
'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_libvirtd_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 =
+ @CONFIG@
--
2.39.2