mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-08-27 19:11:16 +00:00
conf: Change virNWFilterObjDeleteDef to virNWFilterDeleteDef
Rather than pass the nwfilter object, just pass the def to the function
This commit is contained in:
parent
22426736b9
commit
cab7b8c276
@ -3263,21 +3263,19 @@ virNWFilterSaveDef(const char *configDir,
|
|||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
virNWFilterObjDeleteDef(const char *configDir,
|
virNWFilterDeleteDef(const char *configDir,
|
||||||
virNWFilterObjPtr nwfilter)
|
virNWFilterDefPtr def)
|
||||||
{
|
{
|
||||||
int ret = -1;
|
int ret = -1;
|
||||||
char *configFile = NULL;
|
char *configFile = NULL;
|
||||||
|
|
||||||
if (!(configFile = virFileBuildPath(configDir,
|
if (!(configFile = virFileBuildPath(configDir, def->name, ".xml")))
|
||||||
nwfilter->def->name, ".xml"))) {
|
|
||||||
goto error;
|
goto error;
|
||||||
}
|
|
||||||
|
|
||||||
if (unlink(configFile) < 0) {
|
if (unlink(configFile) < 0) {
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
_("cannot remove config for %s"),
|
_("cannot remove config for %s"),
|
||||||
nwfilter->def->name);
|
def->name);
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -614,8 +614,8 @@ virNWFilterObjPtr virNWFilterObjFindByName(virNWFilterObjListPtr nwfilters,
|
|||||||
int virNWFilterSaveDef(const char *configDir,
|
int virNWFilterSaveDef(const char *configDir,
|
||||||
virNWFilterDefPtr def);
|
virNWFilterDefPtr def);
|
||||||
|
|
||||||
int virNWFilterObjDeleteDef(const char *configDir,
|
int virNWFilterDeleteDef(const char *configDir,
|
||||||
virNWFilterObjPtr nwfilter);
|
virNWFilterDefPtr def);
|
||||||
|
|
||||||
virNWFilterObjPtr virNWFilterObjAssignDef(virNWFilterObjListPtr nwfilters,
|
virNWFilterObjPtr virNWFilterObjAssignDef(virNWFilterObjListPtr nwfilters,
|
||||||
virNWFilterDefPtr def);
|
virNWFilterDefPtr def);
|
||||||
|
@ -743,11 +743,11 @@ virNWFilterDefFormat;
|
|||||||
virNWFilterDefFree;
|
virNWFilterDefFree;
|
||||||
virNWFilterDefParseFile;
|
virNWFilterDefParseFile;
|
||||||
virNWFilterDefParseString;
|
virNWFilterDefParseString;
|
||||||
|
virNWFilterDeleteDef;
|
||||||
virNWFilterInstFiltersOnAllVMs;
|
virNWFilterInstFiltersOnAllVMs;
|
||||||
virNWFilterJumpTargetTypeToString;
|
virNWFilterJumpTargetTypeToString;
|
||||||
virNWFilterLoadAllConfigs;
|
virNWFilterLoadAllConfigs;
|
||||||
virNWFilterObjAssignDef;
|
virNWFilterObjAssignDef;
|
||||||
virNWFilterObjDeleteDef;
|
|
||||||
virNWFilterObjFindByName;
|
virNWFilterObjFindByName;
|
||||||
virNWFilterObjFindByUUID;
|
virNWFilterObjFindByUUID;
|
||||||
virNWFilterObjListFree;
|
virNWFilterObjListFree;
|
||||||
|
@ -603,7 +603,7 @@ nwfilterUndefine(virNWFilterPtr obj)
|
|||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (virNWFilterObjDeleteDef(driver->configDir, nwfilter) < 0)
|
if (virNWFilterDeleteDef(driver->configDir, nwfilter->def) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
virNWFilterObjRemove(&driver->nwfilters, nwfilter);
|
virNWFilterObjRemove(&driver->nwfilters, nwfilter);
|
||||||
|
Loading…
Reference in New Issue
Block a user