[PATCH 17/43] conf: storage: Provide only virStorageVolDefParse

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

 



Remove the virStorageVolDefParseFile/String shim functions.

Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx>
---
 src/conf/storage_conf.c            | 20 +-------------------
 src/conf/storage_conf.h            | 12 ++++--------
 src/esx/esx_storage_backend_vmfs.c |  4 ++--
 src/libvirt_private.syms           |  3 +--
 src/storage/storage_driver.c       |  6 ++----
 src/test/test_driver.c             |  4 ++--
 src/vbox/vbox_storage.c            |  2 +-
 tests/storagevolxml2argvtest.c     |  4 ++--
 tests/storagevolxml2xmltest.c      |  2 +-
 9 files changed, 16 insertions(+), 41 deletions(-)

diff --git a/src/conf/storage_conf.c b/src/conf/storage_conf.c
index 703149241a..4f2f9e7fb1 100644
--- a/src/conf/storage_conf.c
+++ b/src/conf/storage_conf.c
@@ -1401,7 +1401,7 @@ virStorageVolDefParseXML(virStoragePoolDef *pool,
 }


-static virStorageVolDef *
+virStorageVolDef *
 virStorageVolDefParse(virStoragePoolDef *pool,
                       const char *xmlStr,
                       const char *filename,
@@ -1418,24 +1418,6 @@ virStorageVolDefParse(virStoragePoolDef *pool,
 }


-virStorageVolDef *
-virStorageVolDefParseString(virStoragePoolDef *pool,
-                            const char *xmlStr,
-                            unsigned int flags)
-{
-    return virStorageVolDefParse(pool, xmlStr, NULL, flags);
-}
-
-
-virStorageVolDef *
-virStorageVolDefParseFile(virStoragePoolDef *pool,
-                          const char *filename,
-                          unsigned int flags)
-{
-    return virStorageVolDefParse(pool, NULL, filename, flags);
-}
-
-
 static void
 virStorageVolTimestampFormat(virBuffer *buf, const char *name,
                              struct timespec *ts)
diff --git a/src/conf/storage_conf.h b/src/conf/storage_conf.h
index 14167af761..bbfdbc2f2f 100644
--- a/src/conf/storage_conf.h
+++ b/src/conf/storage_conf.h
@@ -287,14 +287,10 @@ typedef enum {
 } virStorageVolDefParseFlags;

 virStorageVolDef *
-virStorageVolDefParseString(virStoragePoolDef *pool,
-                            const char *xml,
-                            unsigned int flags);
-
-virStorageVolDef *
-virStorageVolDefParseFile(virStoragePoolDef *pool,
-                          const char *filename,
-                          unsigned int flags);
+virStorageVolDefParse(virStoragePoolDef *pool,
+                      const char *xmlStr,
+                      const char *filename,
+                      unsigned int flags);

 virStorageVolDef *
 virStorageVolDefParseXML(virStoragePoolDef *pool,
diff --git a/src/esx/esx_storage_backend_vmfs.c b/src/esx/esx_storage_backend_vmfs.c
index c718597d72..4efcc2fc75 100644
--- a/src/esx/esx_storage_backend_vmfs.c
+++ b/src/esx/esx_storage_backend_vmfs.c
@@ -861,7 +861,7 @@ esxStorageVolCreateXML(virStoragePoolPtr pool,
     }

     /* Parse config */
-    def = virStorageVolDefParseString(&poolDef, xmldesc, 0);
+    def = virStorageVolDefParse(&poolDef, xmldesc, NULL, 0);

     if (!def)
         goto cleanup;
@@ -1063,7 +1063,7 @@ esxStorageVolCreateXMLFrom(virStoragePoolPtr pool,
                                           sourceVolume->name);

     /* Parse config */
-    def = virStorageVolDefParseString(&poolDef, xmldesc, 0);
+    def = virStorageVolDefParse(&poolDef, xmldesc, NULL, 0);

     if (!def)
         goto cleanup;
diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
index 3191c9d5f7..c1ecd1ab04 100644
--- a/src/libvirt_private.syms
+++ b/src/libvirt_private.syms
@@ -1078,8 +1078,7 @@ virStorageVolDefFindByName;
 virStorageVolDefFindByPath;
 virStorageVolDefFormat;
 virStorageVolDefFree;
-virStorageVolDefParseFile;
-virStorageVolDefParseString;
+virStorageVolDefParse;
 virStorageVolDefParseXML;
 virStorageVolDefRefreshAllocationTypeFromString;
 virStorageVolDefRefreshAllocationTypeToString;
diff --git a/src/storage/storage_driver.c b/src/storage/storage_driver.c
index aefe638083..c25d9ca1ad 100644
--- a/src/storage/storage_driver.c
+++ b/src/storage/storage_driver.c
@@ -1893,8 +1893,7 @@ storageVolCreateXML(virStoragePoolPtr pool,
     if ((backend = virStorageBackendForType(def->type)) == NULL)
         goto cleanup;

-    voldef = virStorageVolDefParseString(def, xmldesc,
-                                         VIR_VOL_XML_PARSE_OPT_CAPACITY);
+    voldef = virStorageVolDefParse(def, xmldesc, NULL, VIR_VOL_XML_PARSE_OPT_CAPACITY);
     if (voldef == NULL)
         goto cleanup;

@@ -2067,8 +2066,7 @@ storageVolCreateXMLFrom(virStoragePoolPtr pool,
         goto cleanup;
     }

-    voldef = virStorageVolDefParseString(def, xmldesc,
-                                         VIR_VOL_XML_PARSE_NO_CAPACITY);
+    voldef = virStorageVolDefParse(def, xmldesc, NULL, VIR_VOL_XML_PARSE_NO_CAPACITY);
     if (voldef == NULL)
         goto cleanup;

diff --git a/src/test/test_driver.c b/src/test/test_driver.c
index 943c0834cd..5a4e240d35 100644
--- a/src/test/test_driver.c
+++ b/src/test/test_driver.c
@@ -7198,7 +7198,7 @@ testStorageVolCreateXML(virStoragePoolPtr pool,
         return NULL;
     def = virStoragePoolObjGetDef(obj);

-    privvol = virStorageVolDefParseString(def, xmldesc, 0);
+    privvol = virStorageVolDefParse(def, xmldesc, NULL, 0);
     if (privvol == NULL)
         goto cleanup;

@@ -7257,7 +7257,7 @@ testStorageVolCreateXMLFrom(virStoragePoolPtr pool,
         return NULL;
     def = virStoragePoolObjGetDef(obj);

-    privvol = virStorageVolDefParseString(def, xmldesc, 0);
+    privvol = virStorageVolDefParse(def, xmldesc, NULL, 0);
     if (privvol == NULL)
         goto cleanup;

diff --git a/src/vbox/vbox_storage.c b/src/vbox/vbox_storage.c
index be609033e1..7d1cee562f 100644
--- a/src/vbox/vbox_storage.c
+++ b/src/vbox/vbox_storage.c
@@ -423,7 +423,7 @@ vboxStorageVolCreateXML(virStoragePoolPtr pool,
     memset(&poolDef, 0, sizeof(poolDef));
     poolDef.type = VIR_STORAGE_POOL_DIR;

-    if ((def = virStorageVolDefParseString(&poolDef, xml, 0)) == NULL)
+    if ((def = virStorageVolDefParse(&poolDef, xml, NULL, 0)) == NULL)
         goto cleanup;

     if (!def->name ||
diff --git a/tests/storagevolxml2argvtest.c b/tests/storagevolxml2argvtest.c
index 22b4cda5c5..0b7848d9ea 100644
--- a/tests/storagevolxml2argvtest.c
+++ b/tests/storagevolxml2argvtest.c
@@ -65,11 +65,11 @@ testCompareXMLToArgvFiles(bool shouldFail,
     if (inputvolxml)
         parse_flags |= VIR_VOL_XML_PARSE_NO_CAPACITY;

-    if (!(vol = virStorageVolDefParseFile(def, volxml, parse_flags)))
+    if (!(vol = virStorageVolDefParse(def, NULL, volxml, parse_flags)))
         goto cleanup;

     if (inputvolxml &&
-        !(inputvol = virStorageVolDefParseFile(inputpool, inputvolxml, 0)))
+        !(inputvol = virStorageVolDefParse(inputpool, NULL, inputvolxml, 0)))
         goto cleanup;

     testSetVolumeType(vol, def);
diff --git a/tests/storagevolxml2xmltest.c b/tests/storagevolxml2xmltest.c
index 7b229ac52a..3ea54e6a7a 100644
--- a/tests/storagevolxml2xmltest.c
+++ b/tests/storagevolxml2xmltest.c
@@ -22,7 +22,7 @@ testCompareXMLToXMLFiles(const char *poolxml, const char *inxml,
     if (!(pool = virStoragePoolDefParse(NULL, poolxml, 0)))
         return -1;

-    if (!(dev = virStorageVolDefParseFile(pool, inxml, flags)))
+    if (!(dev = virStorageVolDefParse(pool, NULL, inxml, flags)))
         return -1;

     if (!(actual = virStorageVolDefFormat(pool, dev)))
-- 
2.37.3




[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