[PATCH 04/17] nwfilter: Remove need for virNWFilterSaveXML

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

 



Merge code into virNWFilterSaveConfig

Signed-off-by: John Ferlan <jferlan@xxxxxxxxxx>
---
 src/conf/nwfilter_conf.c | 30 +++++++-----------------------
 src/conf/nwfilter_conf.h |  5 -----
 2 files changed, 7 insertions(+), 28 deletions(-)

diff --git a/src/conf/nwfilter_conf.c b/src/conf/nwfilter_conf.c
index 032700c..fba792a 100644
--- a/src/conf/nwfilter_conf.c
+++ b/src/conf/nwfilter_conf.c
@@ -2767,13 +2767,16 @@ virNWFilterDefParseFile(const char *filename)
 
 
 int
-virNWFilterSaveXML(const char *configDir,
-                   virNWFilterDefPtr def,
-                   const char *xml)
+virNWFilterSaveConfig(const char *configDir,
+                      virNWFilterDefPtr def)
 {
+    int ret = -1;
+    char *xml;
     char uuidstr[VIR_UUID_STRING_BUFLEN];
     char *configFile = NULL;
-    int ret = -1;
+
+    if (!(xml = virNWFilterDefFormat(def)))
+        goto cleanup;
 
     if (!(configFile = virFileBuildPath(configDir, def->name, ".xml")))
         goto cleanup;
@@ -2785,25 +2788,6 @@ virNWFilterSaveXML(const char *configDir,
 
  cleanup:
     VIR_FREE(configFile);
-    return ret;
-}
-
-
-int
-virNWFilterSaveConfig(const char *configDir,
-                      virNWFilterDefPtr def)
-{
-    int ret = -1;
-    char *xml;
-
-    if (!(xml = virNWFilterDefFormat(def)))
-        goto cleanup;
-
-    if (virNWFilterSaveXML(configDir, def, xml) < 0)
-        goto cleanup;
-
-    ret = 0;
- cleanup:
     VIR_FREE(xml);
     return ret;
 }
diff --git a/src/conf/nwfilter_conf.h b/src/conf/nwfilter_conf.h
index 5cac260..4bf5b7c 100644
--- a/src/conf/nwfilter_conf.h
+++ b/src/conf/nwfilter_conf.h
@@ -581,11 +581,6 @@ char *
 virNWFilterDefFormat(const virNWFilterDef *def);
 
 int
-virNWFilterSaveXML(const char *configDir,
-                   virNWFilterDefPtr def,
-                   const char *xml);
-
-int
 virNWFilterSaveConfig(const char *configDir,
                       virNWFilterDefPtr def);
 
-- 
2.9.4

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