If libvirtd is restarted, let's be sure to block any odd attempts to
update the nwfilters or allow any sort of callbacks from running guests
until all the objects are populated.
Signed-off-by: John Ferlan <jferlan(a)redhat.com>
---
src/nwfilter/nwfilter_driver.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/src/nwfilter/nwfilter_driver.c b/src/nwfilter/nwfilter_driver.c
index 2f9a51c405..06d5847ca7 100644
--- a/src/nwfilter/nwfilter_driver.c
+++ b/src/nwfilter/nwfilter_driver.c
@@ -244,18 +244,24 @@ nwfilterStateInitialize(bool privileged,
goto error;
}
+ virNWFilterWriteLockFilterUpdates();
+ virNWFilterCallbackDriversLock();
if (!(driver->nwfilters = virNWFilterObjListNew()))
goto error;
if (virNWFilterObjListLoadAllConfigs(driver->nwfilters, driver->configDir) <
0)
goto error;
+ virNWFilterCallbackDriversUnlock();
+ virNWFilterUnlockFilterUpdates();
nwfilterDriverUnlock();
return 0;
error:
VIR_FREE(base);
+ virNWFilterCallbackDriversUnlock();
+ virNWFilterUnlockFilterUpdates();
nwfilterDriverUnlock();
nwfilterStateCleanup();
--
2.13.6