[PATCH v3 1/5] nwfilter: Add update locking to Initialization

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
---
 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

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]
  Powered by Linux