Rather than pass the nwfilter object, just pass the def to the function
Signed-off-by: John Ferlan <jferlan(a)redhat.com>
---
src/conf/nwfilter_conf.c | 10 ++++------
src/conf/nwfilter_conf.h | 4 ++--
src/libvirt_private.syms | 2 +-
src/nwfilter/nwfilter_driver.c | 2 +-
4 files changed, 8 insertions(+), 10 deletions(-)
diff --git a/src/conf/nwfilter_conf.c b/src/conf/nwfilter_conf.c
index 855fec7..f529081 100644
--- a/src/conf/nwfilter_conf.c
+++ b/src/conf/nwfilter_conf.c
@@ -3263,21 +3263,19 @@ virNWFilterSaveDef(const char *configDir,
int
-virNWFilterObjDeleteDef(const char *configDir,
- virNWFilterObjPtr nwfilter)
+virNWFilterDeleteDef(const char *configDir,
+ virNWFilterDefPtr def)
{
int ret = -1;
char *configFile = NULL;
- if (!(configFile = virFileBuildPath(configDir,
- nwfilter->def->name, ".xml"))) {
+ if (!(configFile = virFileBuildPath(configDir, def->name, ".xml")))
goto error;
- }
if (unlink(configFile) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("cannot remove config for %s"),
- nwfilter->def->name);
+ def->name);
goto error;
}
diff --git a/src/conf/nwfilter_conf.h b/src/conf/nwfilter_conf.h
index 2211c2a..d87da0c 100644
--- a/src/conf/nwfilter_conf.h
+++ b/src/conf/nwfilter_conf.h
@@ -614,8 +614,8 @@ virNWFilterObjPtr virNWFilterObjFindByName(virNWFilterObjListPtr
nwfilters,
int virNWFilterSaveDef(const char *configDir,
virNWFilterDefPtr def);
-int virNWFilterObjDeleteDef(const char *configDir,
- virNWFilterObjPtr nwfilter);
+int virNWFilterDeleteDef(const char *configDir,
+ virNWFilterDefPtr def);
virNWFilterObjPtr virNWFilterObjAssignDef(virNWFilterObjListPtr nwfilters,
virNWFilterDefPtr def);
diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
index cfc0cbc..80fe9d8 100644
--- a/src/libvirt_private.syms
+++ b/src/libvirt_private.syms
@@ -743,11 +743,11 @@ virNWFilterDefFormat;
virNWFilterDefFree;
virNWFilterDefParseFile;
virNWFilterDefParseString;
+virNWFilterDeleteDef;
virNWFilterInstFiltersOnAllVMs;
virNWFilterJumpTargetTypeToString;
virNWFilterLoadAllConfigs;
virNWFilterObjAssignDef;
-virNWFilterObjDeleteDef;
virNWFilterObjFindByName;
virNWFilterObjFindByUUID;
virNWFilterObjListFree;
diff --git a/src/nwfilter/nwfilter_driver.c b/src/nwfilter/nwfilter_driver.c
index fe5fa54..5e4f076 100644
--- a/src/nwfilter/nwfilter_driver.c
+++ b/src/nwfilter/nwfilter_driver.c
@@ -603,7 +603,7 @@ nwfilterUndefine(virNWFilterPtr obj)
goto cleanup;
}
- if (virNWFilterObjDeleteDef(driver->configDir, nwfilter) < 0)
+ if (virNWFilterDeleteDef(driver->configDir, nwfilter->def) < 0)
goto cleanup;
virNWFilterObjRemove(&driver->nwfilters, nwfilter);
--
2.9.3