mirror of https://gitee.com/openkylin/libvirt.git
conf: nwfilter: Provide only virNWFilterDefParse
Replace virNWFilterDefParseString/File with the common function. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
2a8998d427
commit
5ea1d04322
|
@ -2685,7 +2685,7 @@ virNWFilterDefParseXML(xmlXPathContextPtr ctxt)
|
|||
}
|
||||
|
||||
|
||||
static virNWFilterDef *
|
||||
virNWFilterDef *
|
||||
virNWFilterDefParse(const char *xmlStr,
|
||||
const char *filename,
|
||||
unsigned int flags)
|
||||
|
@ -2702,21 +2702,6 @@ virNWFilterDefParse(const char *xmlStr,
|
|||
}
|
||||
|
||||
|
||||
virNWFilterDef *
|
||||
virNWFilterDefParseString(const char *xmlStr,
|
||||
unsigned int flags)
|
||||
{
|
||||
return virNWFilterDefParse(xmlStr, NULL, flags);
|
||||
}
|
||||
|
||||
|
||||
virNWFilterDef *
|
||||
virNWFilterDefParseFile(const char *filename)
|
||||
{
|
||||
return virNWFilterDefParse(NULL, filename, 0);
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
virNWFilterSaveConfig(const char *configDir,
|
||||
virNWFilterDef *def)
|
||||
|
|
|
@ -541,12 +541,10 @@ virNWFilterSaveConfig(const char *configDir,
|
|||
virNWFilterDef *def);
|
||||
|
||||
virNWFilterDef *
|
||||
virNWFilterDefParseString(const char *xml,
|
||||
virNWFilterDefParse(const char *xmlStr,
|
||||
const char *filename,
|
||||
unsigned int flags);
|
||||
|
||||
virNWFilterDef *
|
||||
virNWFilterDefParseFile(const char *filename);
|
||||
|
||||
typedef int (*virNWFilterTriggerRebuildCallback)(void *opaque);
|
||||
|
||||
int
|
||||
|
|
|
@ -578,7 +578,7 @@ virNWFilterObjListLoadConfig(virNWFilterObjList *nwfilters,
|
|||
if (!(configFile = virFileBuildPath(configDir, name, ".xml")))
|
||||
goto error;
|
||||
|
||||
if (!(def = virNWFilterDefParseFile(configFile)))
|
||||
if (!(def = virNWFilterDefParse(NULL, configFile, 0)))
|
||||
goto error;
|
||||
|
||||
if (STRNEQ(name, def->name)) {
|
||||
|
|
|
@ -952,8 +952,7 @@ virNWFilterConfLayerInit;
|
|||
virNWFilterConfLayerShutdown;
|
||||
virNWFilterDefFormat;
|
||||
virNWFilterDefFree;
|
||||
virNWFilterDefParseFile;
|
||||
virNWFilterDefParseString;
|
||||
virNWFilterDefParse;
|
||||
virNWFilterDeleteDef;
|
||||
virNWFilterJumpTargetTypeToString;
|
||||
virNWFilterPrintStateMatchFlags;
|
||||
|
|
|
@ -545,7 +545,7 @@ nwfilterDefineXMLFlags(virConnectPtr conn,
|
|||
return NULL;
|
||||
}
|
||||
|
||||
if (!(def = virNWFilterDefParseString(xml, flags)))
|
||||
if (!(def = virNWFilterDefParse(xml, NULL, flags)))
|
||||
goto cleanup;
|
||||
|
||||
if (virNWFilterDefineXMLFlagsEnsureACL(conn, def) < 0)
|
||||
|
|
|
@ -255,7 +255,7 @@ virNWFilterDefToInst(const char *xml,
|
|||
{
|
||||
size_t i;
|
||||
int ret = -1;
|
||||
virNWFilterDef *def = virNWFilterDefParseFile(xml);
|
||||
virNWFilterDef *def = virNWFilterDefParse(NULL, xml, 0);
|
||||
|
||||
if (!def)
|
||||
return -1;
|
||||
|
|
|
@ -21,7 +21,7 @@ testCompareXMLToXMLFiles(const char *inxml, const char *outxml,
|
|||
|
||||
virResetLastError();
|
||||
|
||||
if (!(dev = virNWFilterDefParseFile(inxml))) {
|
||||
if (!(dev = virNWFilterDefParse(NULL, inxml, 0))) {
|
||||
if (expect_error) {
|
||||
virResetLastError();
|
||||
goto done;
|
||||
|
|
Loading…
Reference in New Issue