On 8/20/21 1:57 PM, Kristina Hanicova wrote:
> I have added a new driver function which allows to define
> nwfilter with given flags. I have also replaced definition of
> nwfilterDefineXML() with function call to the new function.
> 
> Signed-off-by: Kristina Hanicova <[email protected]>
> ---
>  src/nwfilter/nwfilter_driver.c | 19 ++++++++++++++++---
>  1 file changed, 16 insertions(+), 3 deletions(-)
> 
> diff --git a/src/nwfilter/nwfilter_driver.c b/src/nwfilter/nwfilter_driver.c
> index edb284aa4b..4b355ffff1 100644
> --- a/src/nwfilter/nwfilter_driver.c
> +++ b/src/nwfilter/nwfilter_driver.c
> @@ -525,9 +525,11 @@ nwfilterConnectListAllNWFilters(virConnectPtr conn,
>      return ret;
>  }
>  
> +
>  static virNWFilterPtr
> -nwfilterDefineXML(virConnectPtr conn,
> -                  const char *xml)
> +nwfilterDefineXMLFlags(virConnectPtr conn,
> +                       const char *xml,
> +                       unsigned int flags)
>  {
>      virNWFilterDef *def;
>      virNWFilterObj *obj = NULL;
> @@ -540,13 +542,15 @@ nwfilterDefineXML(virConnectPtr conn,
>          return NULL;
>      }
>  
> +    virCheckFlags(0, NULL);
> +

I think this check should go before !driver->privileged check. That way
it's consistent with the rest of the code.

Michal

Reply via email to