[PATCH 1/6] conf: Change virNWFilterObjSaveDef to virNWFilterSaveDef

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

 



There's no need to pass the driver pointer to nwfilter_conf, just
pass the configDir.

Signed-off-by: John Ferlan <jferlan@xxxxxxxxxx>
---
 src/conf/nwfilter_conf.c       | 12 +++++-------
 src/conf/nwfilter_conf.h       |  4 ++--
 src/libvirt_private.syms       |  2 +-
 src/nwfilter/nwfilter_driver.c |  2 +-
 4 files changed, 9 insertions(+), 11 deletions(-)

diff --git a/src/conf/nwfilter_conf.c b/src/conf/nwfilter_conf.c
index 2cdcfa7..855fec7 100644
--- a/src/conf/nwfilter_conf.c
+++ b/src/conf/nwfilter_conf.c
@@ -3226,25 +3226,23 @@ virNWFilterLoadAllConfigs(virNWFilterObjListPtr nwfilters,
 
 
 int
-virNWFilterObjSaveDef(virNWFilterDriverStatePtr driver,
-                      virNWFilterDefPtr def)
+virNWFilterSaveDef(const char *configDir,
+                   virNWFilterDefPtr def)
 {
     char uuidstr[VIR_UUID_STRING_BUFLEN];
     char *xml;
     int ret = -1;
     char *configFile = NULL;
 
-    if (virFileMakePath(driver->configDir) < 0) {
+    if (virFileMakePath(configDir) < 0) {
         virReportSystemError(errno,
                              _("cannot create config directory %s"),
-                             driver->configDir);
+                             configDir);
         goto error;
     }
 
-    if (!(configFile = virFileBuildPath(driver->configDir,
-                                        def->name, ".xml"))) {
+    if (!(configFile = virFileBuildPath(configDir, def->name, ".xml")))
         goto error;
-    }
 
     if (!(xml = virNWFilterDefFormat(def))) {
         virReportError(VIR_ERR_INTERNAL_ERROR,
diff --git a/src/conf/nwfilter_conf.h b/src/conf/nwfilter_conf.h
index ea3cd5c..2211c2a 100644
--- a/src/conf/nwfilter_conf.h
+++ b/src/conf/nwfilter_conf.h
@@ -611,8 +611,8 @@ virNWFilterObjPtr virNWFilterObjFindByName(virNWFilterObjListPtr nwfilters,
                                            const char *name);
 
 
-int virNWFilterObjSaveDef(virNWFilterDriverStatePtr driver,
-                          virNWFilterDefPtr def);
+int virNWFilterSaveDef(const char *configDir,
+                       virNWFilterDefPtr def);
 
 int virNWFilterObjDeleteDef(const char *configDir,
                             virNWFilterObjPtr nwfilter);
diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
index b550507..cfc0cbc 100644
--- a/src/libvirt_private.syms
+++ b/src/libvirt_private.syms
@@ -753,7 +753,6 @@ virNWFilterObjFindByUUID;
 virNWFilterObjListFree;
 virNWFilterObjLock;
 virNWFilterObjRemove;
-virNWFilterObjSaveDef;
 virNWFilterObjUnlock;
 virNWFilterPrintStateMatchFlags;
 virNWFilterPrintTCPFlags;
@@ -765,6 +764,7 @@ virNWFilterRuleIsProtocolEthernet;
 virNWFilterRuleIsProtocolIPv4;
 virNWFilterRuleIsProtocolIPv6;
 virNWFilterRuleProtocolTypeToString;
+virNWFilterSaveDef;
 virNWFilterTestUnassignDef;
 virNWFilterUnlockFilterUpdates;
 virNWFilterUnRegisterCallbackDriver;
diff --git a/src/nwfilter/nwfilter_driver.c b/src/nwfilter/nwfilter_driver.c
index 186830c..fe5fa54 100644
--- a/src/nwfilter/nwfilter_driver.c
+++ b/src/nwfilter/nwfilter_driver.c
@@ -555,7 +555,7 @@ nwfilterDefineXML(virConnectPtr conn,
     if (!(nwfilter = virNWFilterObjAssignDef(&driver->nwfilters, def)))
         goto cleanup;
 
-    if (virNWFilterObjSaveDef(driver, def) < 0) {
+    if (virNWFilterSaveDef(driver->configDir, def) < 0) {
         virNWFilterObjRemove(&driver->nwfilters, nwfilter);
         def = NULL;
         goto cleanup;
-- 
2.9.3

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