Replace the virSecretDefParseFile/String shims by calls to
virSecretDefParse.
Signed-off-by: Peter Krempa <pkrempa(a)redhat.com>
---
src/conf/secret_conf.c | 14 +-------------
src/conf/secret_conf.h | 7 +++++--
src/conf/virsecretobj.c | 2 +-
src/libvirt_private.syms | 3 +--
src/secret/secret_driver.c | 2 +-
tests/secretxml2xmltest.c | 2 +-
6 files changed, 10 insertions(+), 20 deletions(-)
diff --git a/src/conf/secret_conf.c b/src/conf/secret_conf.c
index d41d8157cd..629a4a57f7 100644
--- a/src/conf/secret_conf.c
+++ b/src/conf/secret_conf.c
@@ -174,7 +174,7 @@ virSecretParseXML(xmlXPathContext *ctxt)
}
-static virSecretDef *
+virSecretDef *
virSecretDefParse(const char *xmlStr,
const char *filename,
unsigned int flags)
@@ -190,18 +190,6 @@ virSecretDefParse(const char *xmlStr,
return virSecretParseXML(ctxt);
}
-virSecretDef *
-virSecretDefParseString(const char *xmlStr,
- unsigned int flags)
-{
- return virSecretDefParse(xmlStr, NULL, flags);
-}
-
-virSecretDef *
-virSecretDefParseFile(const char *filename)
-{
- return virSecretDefParse(NULL, filename, 0);
-}
static int
virSecretDefFormatUsage(virBuffer *buf,
diff --git a/src/conf/secret_conf.h b/src/conf/secret_conf.h
index 36d50407fd..dee98899ac 100644
--- a/src/conf/secret_conf.h
+++ b/src/conf/secret_conf.h
@@ -35,8 +35,11 @@ struct _virSecretDef {
void virSecretDefFree(virSecretDef *def);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(virSecretDef, virSecretDefFree);
-virSecretDef *virSecretDefParseString(const char *xml, unsigned int flags);
-virSecretDef *virSecretDefParseFile(const char *filename);
+virSecretDef *
+virSecretDefParse(const char *xmlStr,
+ const char *filename,
+ unsigned int flags);
+
char *virSecretDefFormat(const virSecretDef *def);
#define VIR_CONNECT_LIST_SECRETS_FILTERS_EPHEMERAL \
diff --git a/src/conf/virsecretobj.c b/src/conf/virsecretobj.c
index 4032cd1e9a..4929f74155 100644
--- a/src/conf/virsecretobj.c
+++ b/src/conf/virsecretobj.c
@@ -870,7 +870,7 @@ virSecretLoad(virSecretObjList *secrets,
virSecretDef *def = NULL;
virSecretObj *obj = NULL;
- if (!(def = virSecretDefParseFile(path)))
+ if (!(def = virSecretDefParse(NULL, path, 0)))
goto cleanup;
if (virSecretLoadValidateUUID(def, file) < 0)
diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
index c1ecd1ab04..6334cbb448 100644
--- a/src/libvirt_private.syms
+++ b/src/libvirt_private.syms
@@ -1010,8 +1010,7 @@ virObjectEventStateQueue;
# conf/secret_conf.h
virSecretDefFormat;
virSecretDefFree;
-virSecretDefParseFile;
-virSecretDefParseString;
+virSecretDefParse;
virSecretUsageTypeFromString;
virSecretUsageTypeToString;
diff --git a/src/secret/secret_driver.c b/src/secret/secret_driver.c
index 6328589fa4..bd981a8ace 100644
--- a/src/secret/secret_driver.c
+++ b/src/secret/secret_driver.c
@@ -207,7 +207,7 @@ secretDefineXML(virConnectPtr conn,
virCheckFlags(VIR_SECRET_DEFINE_VALIDATE, NULL);
- if (!(def = virSecretDefParseString(xml, flags)))
+ if (!(def = virSecretDefParse(xml, NULL, flags)))
return NULL;
if (virSecretDefineXMLEnsureACL(conn, def) < 0)
diff --git a/tests/secretxml2xmltest.c b/tests/secretxml2xmltest.c
index 828e44a32b..eb4d3e143c 100644
--- a/tests/secretxml2xmltest.c
+++ b/tests/secretxml2xmltest.c
@@ -13,7 +13,7 @@ testCompareXMLToXMLFiles(const char *inxml, const char *outxml)
g_autofree char *actual = NULL;
g_autoptr(virSecretDef) secret = NULL;
- if (!(secret = virSecretDefParseFile(inxml)))
+ if (!(secret = virSecretDefParse(NULL, inxml, 0)))
return -1;
if (!(actual = virSecretDefFormat(secret)))
--
2.37.3