Rather than "wait" for the first config file to be created, force creation
of the configDir during driver state initialization.
Signed-off-by: John Ferlan <jferlan@redhat.com>
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),
#include "nwfilter_driver.h"
#include "nwfilter_gentech_driver.h"
#include "configmake.h"
+#include "virfile.h"
#include "virstring.h"
#include "viraccessapicheck.h"
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;