From: Daniel P. Berrangé <[email protected]>

Allow building of the nwfilter driver to be directly controlled.

Signed-off-by: Daniel P. Berrangé <[email protected]>
---
 libvirt.spec.in   | 2 ++
 meson.build       | 9 ++++++++-
 meson_options.txt | 2 ++
 3 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/libvirt.spec.in b/libvirt.spec.in
index a5bb59a105..13ba0a7670 100644
--- a/libvirt.spec.in
+++ b/libvirt.spec.in
@@ -1393,6 +1393,7 @@ export SOURCE_DATE_EPOCH=$(stat --printf='%Y' 
%{_specdir}/libvirt.spec)
            %{?arg_remote_mode} \
            -Ddriver_interface=enabled \
            -Ddriver_network=enabled \
+           -Ddriver_nwfilter=enabled \
            -Dstorage_fs=enabled \
            -Dstorage_lvm=enabled \
            -Dstorage_iscsi=enabled \
@@ -1475,6 +1476,7 @@ export SOURCE_DATE_EPOCH=$(stat --printf='%Y' 
%{_specdir}/libvirt.spec)
   -Ddriver_libxl=disabled \
   -Ddriver_lxc=disabled \
   -Ddriver_network=disabled \
+  -Ddriver_nwfilter=disabled \
   -Ddriver_openvz=disabled \
   -Ddriver_qemu=disabled \
   -Ddriver_secrets=disabled \
diff --git a/meson.build b/meson.build
index 6d5ae23e3e..fb95a73928 100644
--- a/meson.build
+++ b/meson.build
@@ -2006,8 +2006,14 @@ endif
 
 # nwfilter should only be compiled for linux, and only if the
 # libvirt daemon is also being compiled
-if conf.has('WITH_LIBVIRTD') and host_machine.system() == 'linux'
+if not get_option('driver_nwfilter').disabled() and conf.has('WITH_LIBVIRTD') 
and host_machine.system() == 'linux'
   conf.set('WITH_NWFILTER', 1)
+elif get_option('driver_nwfilter').enabled()
+  if not conf.has('WITH_LIBVIRTD')
+    error('libvirtd must be enabled to build the network driver')
+  else
+    error('linux host is required to build the nwfilter driver')
+  endif
 endif
 
 if conf.has('WITH_NWFILTER') or conf.has('WITH_NETWORK')
@@ -2259,6 +2265,7 @@ driver_summary = {
   'LXC': conf.has('WITH_LXC'),
   'Monolithic libvirtd': conf.has('WITH_MONOLITHIC_LIBVIRTD'),
   'Network': conf.has('WITH_NETWORK'),
+  'NWFilter': conf.has('WITH_NWFLTER'),
   'OpenVZ': conf.has('WITH_OPENVZ'),
   'QEMU': conf.has('WITH_QEMU'),
   'Remote': conf.has('WITH_REMOTE'),
diff --git a/meson_options.txt b/meson_options.txt
index d09c7a630d..4df99a5f87 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -93,6 +93,8 @@ option('driver_interface', type: 'feature', value: 'auto', 
description: 'host in
 # dep:driver_remote dep:driver_libvirtd
 option('driver_network', type: 'feature', value: 'auto', description: 'virtual 
network driver')
 # dep:driver_remote dep:driver_libvirtd
+option('driver_nwfilter', type: 'feature', value: 'auto', description: 
'network filter driver')
+# dep:driver_remote dep:driver_libvirtd
 option('driver_secrets', type: 'feature', value: 'auto', description: 'local 
secrets management driver')
 
 
-- 
2.56.0

Reply via email to