Re: [libvirt PATCH v2 09/15] nwfilter: clear nrules when resetting virNWFilterInst

2020-07-15 Thread Ján Tomko

On a Tuesday in 2020, Laine Stump wrote:

It's possible/probable the callers to virNWFilterInstReset() make it
unnecessary to set the object's nrules to 0 after freeing all its
rules, but that same function is setting nfilters to 0, so let's do
the same for the sake of consistency.

Signed-off-by: Laine Stump 
---
src/nwfilter/nwfilter_gentech_driver.c | 1 +
1 file changed, 1 insertion(+)



Reviewed-by: Ján Tomko 

Jano


signature.asc
Description: PGP signature


[libvirt PATCH v2 09/15] nwfilter: clear nrules when resetting virNWFilterInst

2020-07-07 Thread Laine Stump
It's possible/probable the callers to virNWFilterInstReset() make it
unnecessary to set the object's nrules to 0 after freeing all its
rules, but that same function is setting nfilters to 0, so let's do
the same for the sake of consistency.

Signed-off-by: Laine Stump 
---
 src/nwfilter/nwfilter_gentech_driver.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/nwfilter/nwfilter_gentech_driver.c 
b/src/nwfilter/nwfilter_gentech_driver.c
index b7633eb10a..aff42cbfb0 100644
--- a/src/nwfilter/nwfilter_gentech_driver.c
+++ b/src/nwfilter/nwfilter_gentech_driver.c
@@ -240,6 +240,7 @@ virNWFilterInstReset(virNWFilterInstPtr inst)
 for (i = 0; i < inst->nrules; i++)
 virNWFilterRuleInstFree(inst->rules[i]);
 VIR_FREE(inst->rules);
+inst->nrules = 0;
 }
 
 
-- 
2.25.4