From cab7b8c276fd02021c8e709ffa83ca2daa32762c Mon Sep 17 00:00:00 2001 From: John Ferlan Date: Tue, 28 Feb 2017 17:25:36 -0500 Subject: [PATCH] conf: Change virNWFilterObjDeleteDef to virNWFilterDeleteDef Rather than pass the nwfilter object, just pass the def to the function --- 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 855fec78bb..f5290810b7 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 2211c2aa72..d87da0c6b8 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 b4553a90e8..0c6ea2b58d 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 fe5fa548fb..5e4f07655c 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); -- GitLab