提交 245f1d85 编写于 作者: J John Ferlan

nwfilter: Move creation of configDir to driver initialization

Rather than "wait" for the first config file to be created, force creation
of the configDir during driver state initialization.
Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
上级 119a6b30
......@@ -2778,13 +2778,6 @@ virNWFilterSaveXML(const char *configDir,
if (!(configFile = virFileBuildPath(configDir, def->name, ".xml")))
goto cleanup;
if (virFileMakePath(configDir) < 0) {
virReportSystemError(errno,
_("cannot create config directory '%s'"),
configDir);
goto cleanup;
}
virUUIDFormat(def->uuid, uuidstr);
ret = virXMLSaveFile(configFile,
virXMLPickShellSafeComment(def->name, uuidstr),
......
......@@ -40,6 +40,7 @@
#include "nwfilter_driver.h"
#include "nwfilter_gentech_driver.h"
#include "configmake.h"
#include "virfile.h"
#include "virstring.h"
#include "viraccessapicheck.h"
......@@ -237,6 +238,12 @@ nwfilterStateInitialize(bool privileged,
VIR_FREE(base);
if (virFileMakePathWithMode(driver->configDir, S_IRWXU) < 0) {
virReportSystemError(errno, _("cannot create config directory '%s'"),
driver->configDir);
goto error;
}
if (!(driver->nwfilters = virNWFilterObjListNew()))
goto error;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册