[PATCH] build: disable nwfilter if network is disabled

Marek Marczykowski-Górecki posted 1 patch 1 week, 1 day ago
meson.build | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] build: disable nwfilter if network is disabled
Posted by Marek Marczykowski-Górecki 1 week, 1 day ago
Otherwise build with -Ddriver_network=disabled fails with:

    src/nwfilter/meson.build:51:43: ERROR: Unknown variable "firewall_backend_priority".

Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
---
 meson.build | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meson.build b/meson.build
index 927665b5fb..26cf3aca21 100644
--- a/meson.build
+++ b/meson.build
@@ -2031,7 +2031,7 @@ 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 conf.has('WITH_LIBVIRTD') and conf.has('WITH_NETWORK') and host_machine.system() == 'linux'
   conf.set('WITH_NWFILTER', 1)
 endif
 
-- 
2.54.0

Re: [PATCH] build: disable nwfilter if network is disabled
Posted by Daniel P. Berrangé via Devel 1 week, 1 day ago
On Fri, Oct 16, 2026 at 02:16:28AM +0200, Marek Marczykowski-Górecki wrote:
> Otherwise build with -Ddriver_network=disabled fails with:
> 
>     src/nwfilter/meson.build:51:43: ERROR: Unknown variable "firewall_backend_priority".
> 
> Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
> ---
>  meson.build | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/meson.build b/meson.build
> index 927665b5fb..26cf3aca21 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -2031,7 +2031,7 @@ 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 conf.has('WITH_LIBVIRTD') and conf.has('WITH_NETWORK') and host_machine.system() == 'linux'
>    conf.set('WITH_NWFILTER', 1)
>  endif

This is wrong - the nwfilter driver has no dependency on the virtual
network driver.  The bug here is the earlier meson.build logic
has firewall_backend_priority set in a conditional that needs fixing

With regards,
Daniel
-- 
|: https://berrange.com       ~~        https://hachyderm.io/@berrange :|
|: https://libvirt.org          ~~          https://entangle-photo.org :|
|: https://pixelfed.art/berrange   ~~    https://fstop138.berrange.com :|

Re: [PATCH] build: disable nwfilter if network is disabled
Posted by Michal Prívozník via Devel 1 week, 1 day ago
On 10/16/26 02:16, Marek Marczykowski-Górecki wrote:
> Otherwise build with -Ddriver_network=disabled fails with:
> 
>     src/nwfilter/meson.build:51:43: ERROR: Unknown variable "firewall_backend_priority".
> 
> Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
> ---
>  meson.build | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 

 Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Michal