mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-09 06:25:19 +00:00
conf: Change virNWFilterObjSaveDef to virNWFilterSaveDef
There's no need to pass the driver pointer to nwfilter_conf, just pass the configDir.
This commit is contained in:
parent
15b881474b
commit
22426736b9
@ -3226,25 +3226,23 @@ virNWFilterLoadAllConfigs(virNWFilterObjListPtr nwfilters,
|
||||
|
||||
|
||||
int
|
||||
virNWFilterObjSaveDef(virNWFilterDriverStatePtr driver,
|
||||
virNWFilterDefPtr def)
|
||||
virNWFilterSaveDef(const char *configDir,
|
||||
virNWFilterDefPtr def)
|
||||
{
|
||||
char uuidstr[VIR_UUID_STRING_BUFLEN];
|
||||
char *xml;
|
||||
int ret = -1;
|
||||
char *configFile = NULL;
|
||||
|
||||
if (virFileMakePath(driver->configDir) < 0) {
|
||||
if (virFileMakePath(configDir) < 0) {
|
||||
virReportSystemError(errno,
|
||||
_("cannot create config directory %s"),
|
||||
driver->configDir);
|
||||
configDir);
|
||||
goto error;
|
||||
}
|
||||
|
||||
if (!(configFile = virFileBuildPath(driver->configDir,
|
||||
def->name, ".xml"))) {
|
||||
if (!(configFile = virFileBuildPath(configDir, def->name, ".xml")))
|
||||
goto error;
|
||||
}
|
||||
|
||||
if (!(xml = virNWFilterDefFormat(def))) {
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
|
@ -611,8 +611,8 @@ virNWFilterObjPtr virNWFilterObjFindByName(virNWFilterObjListPtr nwfilters,
|
||||
const char *name);
|
||||
|
||||
|
||||
int virNWFilterObjSaveDef(virNWFilterDriverStatePtr driver,
|
||||
virNWFilterDefPtr def);
|
||||
int virNWFilterSaveDef(const char *configDir,
|
||||
virNWFilterDefPtr def);
|
||||
|
||||
int virNWFilterObjDeleteDef(const char *configDir,
|
||||
virNWFilterObjPtr nwfilter);
|
||||
|
@ -753,7 +753,6 @@ virNWFilterObjFindByUUID;
|
||||
virNWFilterObjListFree;
|
||||
virNWFilterObjLock;
|
||||
virNWFilterObjRemove;
|
||||
virNWFilterObjSaveDef;
|
||||
virNWFilterObjUnlock;
|
||||
virNWFilterPrintStateMatchFlags;
|
||||
virNWFilterPrintTCPFlags;
|
||||
@ -765,6 +764,7 @@ virNWFilterRuleIsProtocolEthernet;
|
||||
virNWFilterRuleIsProtocolIPv4;
|
||||
virNWFilterRuleIsProtocolIPv6;
|
||||
virNWFilterRuleProtocolTypeToString;
|
||||
virNWFilterSaveDef;
|
||||
virNWFilterTestUnassignDef;
|
||||
virNWFilterUnlockFilterUpdates;
|
||||
virNWFilterUnRegisterCallbackDriver;
|
||||
|
@ -555,7 +555,7 @@ nwfilterDefineXML(virConnectPtr conn,
|
||||
if (!(nwfilter = virNWFilterObjAssignDef(&driver->nwfilters, def)))
|
||||
goto cleanup;
|
||||
|
||||
if (virNWFilterObjSaveDef(driver, def) < 0) {
|
||||
if (virNWFilterSaveDef(driver->configDir, def) < 0) {
|
||||
virNWFilterObjRemove(&driver->nwfilters, nwfilter);
|
||||
def = NULL;
|
||||
goto cleanup;
|
||||
|
Loading…
Reference in New Issue
Block a user