driver->stateDir = g_strdup_printf("%s/interface/run", rundir);
}
- if (virFileMakePathWithMode(driver->stateDir, S_IRWXU) < 0) {
+ if (g_mkdir_with_parents(driver->stateDir, S_IRWXU) < 0) {
virReportSystemError(errno, _("cannot create state directory '%s'"),
driver->stateDir);
goto error;
driver->stateDir = g_strdup_printf("%s/interface/run", rundir);
}
- if (virFileMakePathWithMode(driver->stateDir, S_IRWXU) < 0) {
+ if (g_mkdir_with_parents(driver->stateDir, S_IRWXU) < 0) {
virReportSystemError(errno, _("cannot create state directory '%s'"),
driver->stateDir);
goto cleanup;
driver->stateDir = g_strdup_printf("%s/nodedev/run", rundir);
}
- if (virFileMakePathWithMode(driver->stateDir, S_IRWXU) < 0) {
+ if (g_mkdir_with_parents(driver->stateDir, S_IRWXU) < 0) {
virReportSystemError(errno, _("cannot create state directory '%s'"),
driver->stateDir);
goto cleanup;
{
int tfd;
- if (virFileMakePathWithMode(LEASEFILE_DIR, 0700) < 0) {
+ if (g_mkdir_with_parents(LEASEFILE_DIR, 0700) < 0) {
virReportError(errno, _("mkdir(\"%s\")"), LEASEFILE_DIR);
return;
}
driver->stateDir = g_strdup(RUNSTATEDIR "/libvirt/nwfilter");
- if (virFileMakePathWithMode(driver->stateDir, S_IRWXU) < 0) {
+ if (g_mkdir_with_parents(driver->stateDir, S_IRWXU) < 0) {
virReportSystemError(errno, _("cannot create state directory '%s'"),
driver->stateDir);
goto error;
driver->configDir = g_strdup(SYSCONFDIR "/libvirt/nwfilter");
- if (virFileMakePathWithMode(driver->configDir, S_IRWXU) < 0) {
+ if (g_mkdir_with_parents(driver->configDir, S_IRWXU) < 0) {
virReportSystemError(errno, _("cannot create config directory '%s'"),
driver->configDir);
goto error;
driver->bindingDir = g_strdup(RUNSTATEDIR "/libvirt/nwfilter-binding");
- if (virFileMakePathWithMode(driver->bindingDir, S_IRWXU) < 0) {
+ if (g_mkdir_with_parents(driver->bindingDir, S_IRWXU) < 0) {
virReportSystemError(errno, _("cannot create config directory '%s'"),
driver->bindingDir);
goto error;
goto cleanup;
}
if ((isReg && virFileTouch(data->file, data->sb.st_mode) < 0) ||
- (isDir && virFileMakePathWithMode(data->file, data->sb.st_mode) < 0))
+ (isDir && g_mkdir_with_parents(data->file, data->sb.st_mode) < 0))
goto cleanup;
delDevice = true;
/* Just create the file here so that code below sets
if (virFileExists(path))
return 0;
- if (virFileMakePathWithMode(path, 0700) < 0) {
+ if (g_mkdir_with_parents(path, 0700) < 0) {
virReportSystemError(errno,
_("Unable to create %s"),
path);
virDomainObjPtr vm,
const char *path)
{
- if (virFileMakePathWithMode(path, 0750) < 0) {
+ if (g_mkdir_with_parents(path, 0750) < 0) {
virReportSystemError(errno, _("Cannot create directory '%s'"), path);
return -1;
}
int rc = 0;
/* allow others to cd into this dir */
- if (virFileMakePathWithMode(swtpmStorageDir, 0711) < 0) {
+ if (g_mkdir_with_parents(swtpmStorageDir, 0711) < 0) {
virReportSystemError(errno,
_("Could not create TPM directory %s"),
swtpmStorageDir);
return -1;
/* create log dir ... allow 'tss' user to cd into it */
- if (virFileMakePathWithMode(logDir, 0711) < 0)
+ if (g_mkdir_with_parents(logDir, 0711) < 0)
return -1;
/* ... and adjust ownership */
binname = g_path_get_basename(binary);
rundir = virGetUserRuntimeDirectory();
- if (virFileMakePathWithMode(rundir, 0700) < 0) {
+ if (g_mkdir_with_parents(rundir, 0700) < 0) {
virReportSystemError(errno,
_("Cannot create user runtime directory '%s'"),
rundir);
driver->stateDir = g_strdup_printf("%s/secrets/run", rundir);
}
- if (virFileMakePathWithMode(driver->configDir, S_IRWXU) < 0) {
+ if (g_mkdir_with_parents(driver->configDir, S_IRWXU) < 0) {
virReportSystemError(errno, _("cannot create config directory '%s'"),
driver->configDir);
goto error;
}
- if (virFileMakePathWithMode(driver->stateDir, S_IRWXU) < 0) {
+ if (g_mkdir_with_parents(driver->stateDir, S_IRWXU) < 0) {
virReportSystemError(errno, _("cannot create state directory '%s'"),
driver->stateDir);
goto error;
int
virFileMakePath(const char *path)
{
- return virFileMakePathWithMode(path, 0777);
+ return g_mkdir_with_parents(path, 0777);
}
int
goto error;
}
} else {
- if (virFileMakePathWithMode(directory, 0700) < 0) {
+ if (g_mkdir_with_parents(directory, 0700) < 0) {
virReportSystemError(errno,
_("Unable to create lockspace %s"),
directory);
} else {
rundir = virGetUserRuntimeDirectory();
- if (virFileMakePathWithMode(rundir, 0700) < 0) {
+ if (g_mkdir_with_parents(rundir, 0700) < 0) {
virReportSystemError(errno,
_("Cannot create user runtime directory '%s'"),
rundir);
vz_driver_privileged = privileged;
- if (virFileMakePathWithMode(VZ_STATEDIR, S_IRWXU) < 0) {
+ if (g_mkdir_with_parents(VZ_STATEDIR, S_IRWXU) < 0) {
virReportSystemError(errno, _("cannot create state directory '%s'"),
VZ_STATEDIR);
return VIR_DRV_STATE_INIT_ERROR;
}
spot--;
*spot = '\0';
- if (virFileMakePathWithMode(unique_id_path, 0755) < 0) {
+ if (g_mkdir_with_parents(unique_id_path, 0755) < 0) {
fprintf(stderr, "Unable to make path to '%s'\n", unique_id_path);
goto cleanup;
}
}
spot--;
*spot = '\0';
- if (virFileMakePathWithMode(link_path, 0755) < 0) {
+ if (g_mkdir_with_parents(link_path, 0755) < 0) {
fprintf(stderr, "Unable to make path to '%s'\n", link_path);
goto cleanup;
}
vshReadlineDeinit(vshControl *ctl)
{
if (ctl->historyfile != NULL) {
- if (virFileMakePathWithMode(ctl->historydir, 0755) < 0 &&
+ if (g_mkdir_with_parents(ctl->historydir, 0755) < 0 &&
errno != EEXIST) {
vshError(ctl, _("Failed to create '%s': %s"),
ctl->historydir, g_strerror(errno));