Use "virNWFilterObj" as a prefix for any external API in virnwfilterobj Signed-off-by: John Ferlan <jferlan@xxxxxxxxxx> --- src/conf/virnwfilterobj.c | 34 +++++++++++++++++----------------- src/conf/virnwfilterobj.h | 6 +++--- src/libvirt_private.syms | 4 ++-- src/nwfilter/nwfilter_driver.c | 8 +++----- 4 files changed, 25 insertions(+), 27 deletions(-) diff --git a/src/conf/virnwfilterobj.c b/src/conf/virnwfilterobj.c index 0d81912..7e13afb 100644 --- a/src/conf/virnwfilterobj.c +++ b/src/conf/virnwfilterobj.c @@ -117,9 +117,9 @@ virNWFilterObjFindByName(virNWFilterObjListPtr nwfilters, static int -_virNWFilterDefLoopDetect(virNWFilterObjListPtr nwfilters, - virNWFilterDefPtr def, - const char *filtername) +_virNWFilterObjDefLoopDetect(virNWFilterObjListPtr nwfilters, + virNWFilterDefPtr def, + const char *filtername) { int rc = 0; size_t i; @@ -141,8 +141,8 @@ _virNWFilterDefLoopDetect(virNWFilterObjListPtr nwfilters, obj = virNWFilterObjFindByName(nwfilters, entry->include->filterref); if (obj) { - rc = _virNWFilterDefLoopDetect(nwfilters, - obj->def, filtername); + rc = _virNWFilterObjDefLoopDetect(nwfilters, + obj->def, filtername); virNWFilterObjUnlock(obj); if (rc < 0) @@ -156,7 +156,7 @@ _virNWFilterDefLoopDetect(virNWFilterObjListPtr nwfilters, /* - * virNWFilterDefLoopDetect: + * virNWFilterObjDefLoopDetect: * @nwfilters : the nwfilters to search * @def : the filter definition that may add a loop and is to be tested * @@ -166,15 +166,15 @@ _virNWFilterDefLoopDetect(virNWFilterObjListPtr nwfilters, * Returns 0 in case no loop was detected, -1 otherwise. */ static int -virNWFilterDefLoopDetect(virNWFilterObjListPtr nwfilters, - virNWFilterDefPtr def) +virNWFilterObjDefLoopDetect(virNWFilterObjListPtr nwfilters, + virNWFilterDefPtr def) { - return _virNWFilterDefLoopDetect(nwfilters, def, def->name); + return _virNWFilterObjDefLoopDetect(nwfilters, def, def->name); } int -virNWFilterTestUnassignDef(virNWFilterObjPtr nwfilter) +virNWFilterObjTestUnassignDef(virNWFilterObjPtr nwfilter) { int rc = 0; @@ -252,7 +252,7 @@ virNWFilterObjAssignDef(virNWFilterObjListPtr nwfilters, } } - if (virNWFilterDefLoopDetect(nwfilters, def) < 0) { + if (virNWFilterObjDefLoopDetect(nwfilters, def) < 0) { virReportError(VIR_ERR_OPERATION_FAILED, "%s", _("filter would introduce a loop")); return NULL; @@ -306,9 +306,9 @@ virNWFilterObjAssignDef(virNWFilterObjListPtr nwfilters, static virNWFilterObjPtr -virNWFilterLoadConfig(virNWFilterObjListPtr nwfilters, - const char *configDir, - const char *name) +virNWFilterObjLoadConfig(virNWFilterObjListPtr nwfilters, + const char *configDir, + const char *name) { virNWFilterDefPtr def = NULL; virNWFilterObjPtr nwfilter; @@ -347,8 +347,8 @@ virNWFilterLoadConfig(virNWFilterObjListPtr nwfilters, int -virNWFilterLoadAllConfigs(virNWFilterObjListPtr nwfilters, - const char *configDir) +virNWFilterObjLoadAllConfigs(virNWFilterObjListPtr nwfilters, + const char *configDir) { DIR *dir; struct dirent *entry; @@ -364,7 +364,7 @@ virNWFilterLoadAllConfigs(virNWFilterObjListPtr nwfilters, if (!virFileStripSuffix(entry->d_name, ".xml")) continue; - nwfilter = virNWFilterLoadConfig(nwfilters, configDir, entry->d_name); + nwfilter = virNWFilterObjLoadConfig(nwfilters, configDir, entry->d_name); if (nwfilter) virNWFilterObjUnlock(nwfilter); } diff --git a/src/conf/virnwfilterobj.h b/src/conf/virnwfilterobj.h index 593f426..1d80455 100644 --- a/src/conf/virnwfilterobj.h +++ b/src/conf/virnwfilterobj.h @@ -79,11 +79,11 @@ virNWFilterObjAssignDef(virNWFilterObjListPtr nwfilters, virNWFilterDefPtr def); int -virNWFilterTestUnassignDef(virNWFilterObjPtr nwfilter); +virNWFilterObjTestUnassignDef(virNWFilterObjPtr nwfilter); int -virNWFilterLoadAllConfigs(virNWFilterObjListPtr nwfilters, - const char *configDir); +virNWFilterObjLoadAllConfigs(virNWFilterObjListPtr nwfilters, + const char *configDir); void virNWFilterObjLock(virNWFilterObjPtr obj); diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index 3c4b943..e0caa07 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -957,15 +957,15 @@ virNodeDeviceObjUnlock; # conf/virnwfilterobj.h -virNWFilterLoadAllConfigs; virNWFilterObjAssignDef; virNWFilterObjFindByName; virNWFilterObjFindByUUID; virNWFilterObjListFree; +virNWFilterObjLoadAllConfigs; virNWFilterObjLock; virNWFilterObjRemove; +virNWFilterObjTestUnassignDef; virNWFilterObjUnlock; -virNWFilterTestUnassignDef; # conf/virsecretobj.h diff --git a/src/nwfilter/nwfilter_driver.c b/src/nwfilter/nwfilter_driver.c index 6ce2bfd..4ea216a 100644 --- a/src/nwfilter/nwfilter_driver.c +++ b/src/nwfilter/nwfilter_driver.c @@ -237,8 +237,7 @@ nwfilterStateInitialize(bool privileged, VIR_FREE(base); - if (virNWFilterLoadAllConfigs(&driver->nwfilters, - driver->configDir) < 0) + if (virNWFilterObjLoadAllConfigs(&driver->nwfilters, driver->configDir) < 0) goto error; nwfilterDriverUnlock(); @@ -290,8 +289,7 @@ nwfilterStateReload(void) virNWFilterWriteLockFilterUpdates(); virNWFilterCallbackDriversLock(); - virNWFilterLoadAllConfigs(&driver->nwfilters, - driver->configDir); + virNWFilterObjLoadAllConfigs(&driver->nwfilters, driver->configDir); virNWFilterCallbackDriversUnlock(); virNWFilterUnlockFilterUpdates(); @@ -595,7 +593,7 @@ nwfilterUndefine(virNWFilterPtr obj) if (virNWFilterUndefineEnsureACL(obj->conn, nwfilter->def) < 0) goto cleanup; - if (virNWFilterTestUnassignDef(nwfilter) < 0) { + if (virNWFilterObjTestUnassignDef(nwfilter) < 0) { virReportError(VIR_ERR_OPERATION_INVALID, "%s", _("nwfilter is in use")); -- 2.9.3 -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list