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
|
int
|
||||||
virNWFilterObjSaveDef(virNWFilterDriverStatePtr driver,
|
virNWFilterSaveDef(const char *configDir,
|
||||||
virNWFilterDefPtr def)
|
virNWFilterDefPtr def)
|
||||||
{
|
{
|
||||||
char uuidstr[VIR_UUID_STRING_BUFLEN];
|
char uuidstr[VIR_UUID_STRING_BUFLEN];
|
||||||
char *xml;
|
char *xml;
|
||||||
int ret = -1;
|
int ret = -1;
|
||||||
char *configFile = NULL;
|
char *configFile = NULL;
|
||||||
|
|
||||||
if (virFileMakePath(driver->configDir) < 0) {
|
if (virFileMakePath(configDir) < 0) {
|
||||||
virReportSystemError(errno,
|
virReportSystemError(errno,
|
||||||
_("cannot create config directory %s"),
|
_("cannot create config directory %s"),
|
||||||
driver->configDir);
|
configDir);
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(configFile = virFileBuildPath(driver->configDir,
|
if (!(configFile = virFileBuildPath(configDir, def->name, ".xml")))
|
||||||
def->name, ".xml"))) {
|
|
||||||
goto error;
|
goto error;
|
||||||
}
|
|
||||||
|
|
||||||
if (!(xml = virNWFilterDefFormat(def))) {
|
if (!(xml = virNWFilterDefFormat(def))) {
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
|
@ -611,8 +611,8 @@ virNWFilterObjPtr virNWFilterObjFindByName(virNWFilterObjListPtr nwfilters,
|
|||||||
const char *name);
|
const char *name);
|
||||||
|
|
||||||
|
|
||||||
int virNWFilterObjSaveDef(virNWFilterDriverStatePtr driver,
|
int virNWFilterSaveDef(const char *configDir,
|
||||||
virNWFilterDefPtr def);
|
virNWFilterDefPtr def);
|
||||||
|
|
||||||
int virNWFilterObjDeleteDef(const char *configDir,
|
int virNWFilterObjDeleteDef(const char *configDir,
|
||||||
virNWFilterObjPtr nwfilter);
|
virNWFilterObjPtr nwfilter);
|
||||||
|
@ -753,7 +753,6 @@ virNWFilterObjFindByUUID;
|
|||||||
virNWFilterObjListFree;
|
virNWFilterObjListFree;
|
||||||
virNWFilterObjLock;
|
virNWFilterObjLock;
|
||||||
virNWFilterObjRemove;
|
virNWFilterObjRemove;
|
||||||
virNWFilterObjSaveDef;
|
|
||||||
virNWFilterObjUnlock;
|
virNWFilterObjUnlock;
|
||||||
virNWFilterPrintStateMatchFlags;
|
virNWFilterPrintStateMatchFlags;
|
||||||
virNWFilterPrintTCPFlags;
|
virNWFilterPrintTCPFlags;
|
||||||
@ -765,6 +764,7 @@ virNWFilterRuleIsProtocolEthernet;
|
|||||||
virNWFilterRuleIsProtocolIPv4;
|
virNWFilterRuleIsProtocolIPv4;
|
||||||
virNWFilterRuleIsProtocolIPv6;
|
virNWFilterRuleIsProtocolIPv6;
|
||||||
virNWFilterRuleProtocolTypeToString;
|
virNWFilterRuleProtocolTypeToString;
|
||||||
|
virNWFilterSaveDef;
|
||||||
virNWFilterTestUnassignDef;
|
virNWFilterTestUnassignDef;
|
||||||
virNWFilterUnlockFilterUpdates;
|
virNWFilterUnlockFilterUpdates;
|
||||||
virNWFilterUnRegisterCallbackDriver;
|
virNWFilterUnRegisterCallbackDriver;
|
||||||
|
@ -555,7 +555,7 @@ nwfilterDefineXML(virConnectPtr conn,
|
|||||||
if (!(nwfilter = virNWFilterObjAssignDef(&driver->nwfilters, def)))
|
if (!(nwfilter = virNWFilterObjAssignDef(&driver->nwfilters, def)))
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
if (virNWFilterObjSaveDef(driver, def) < 0) {
|
if (virNWFilterSaveDef(driver->configDir, def) < 0) {
|
||||||
virNWFilterObjRemove(&driver->nwfilters, nwfilter);
|
virNWFilterObjRemove(&driver->nwfilters, nwfilter);
|
||||||
def = NULL;
|
def = NULL;
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
Loading…
Reference in New Issue
Block a user