goto cleanup;
if (autostart) {
- if (virFileMakePath(BHYVE_AUTOSTART_DIR) < 0) {
+ if (g_mkdir_with_parents(BHYVE_AUTOSTART_DIR, 0777) < 0) {
virReportSystemError(errno,
_("cannot create autostart directory %s"),
BHYVE_AUTOSTART_DIR);
if (virBhyveLoadDriverConfig(bhyve_driver->config, SYSCONFDIR "/libvirt/bhyve.conf") < 0)
goto cleanup;
- if (virFileMakePath(BHYVE_LOG_DIR) < 0) {
+ if (g_mkdir_with_parents(BHYVE_LOG_DIR, 0777) < 0) {
virReportSystemError(errno,
_("Failed to mkdir %s"),
BHYVE_LOG_DIR);
goto cleanup;
}
- if (virFileMakePath(BHYVE_STATE_DIR) < 0) {
+ if (g_mkdir_with_parents(BHYVE_STATE_DIR, 0777) < 0) {
virReportSystemError(errno,
_("Failed to mkdir %s"),
BHYVE_STATE_DIR);
if ((configFile = virDomainConfigFile(configDir, def->name)) == NULL)
return -1;
- if (virFileMakePath(configDir) < 0) {
+ if (g_mkdir_with_parents(configDir, 0777) < 0) {
virReportSystemError(errno,
_("cannot create config directory '%s'"),
configDir);
if ((configFile = virNetworkConfigFile(configDir, def->name)) == NULL)
return -1;
- if (virFileMakePath(configDir) < 0) {
+ if (g_mkdir_with_parents(configDir, 0777) < 0) {
virReportSystemError(errno,
_("cannot create config directory '%s'"),
configDir);
virUUIDFormat(def->uuid, uuidstr);
- if (virFileMakePath(dir) < 0)
+ if (g_mkdir_with_parents(dir, 0777) < 0)
return -1;
if (!(path = virNetworkPortDefConfigFile(dir, uuidstr)))
if (!(xml = virNWFilterBindingObjFormat(obj)))
goto cleanup;
- if (virFileMakePath(statusDir) < 0) {
+ if (g_mkdir_with_parents(statusDir, 0777) < 0) {
virReportSystemError(errno,
_("cannot create config directory '%s'"),
statusDir);
virStoragePoolDefPtr def)
{
if (!obj->configFile) {
- if (virFileMakePath(driver->configDir) < 0) {
+ if (g_mkdir_with_parents(driver->configDir, 0777) < 0) {
virReportSystemError(errno,
_("cannot create config directory %s"),
driver->configDir);
if (privileged) {
hostdevMgr->stateDir = g_strdup(HOSTDEV_STATE_DIR);
- if (virFileMakePath(hostdevMgr->stateDir) < 0) {
+ if (g_mkdir_with_parents(hostdevMgr->stateDir, 0777) < 0) {
virReportError(VIR_ERR_OPERATION_FAILED,
_("Failed to create state dir '%s'"),
hostdevMgr->stateDir);
old_umask = umask(077);
- if (virFileMakePath(hostdevMgr->stateDir) < 0) {
+ if (g_mkdir_with_parents(hostdevMgr->stateDir, 0777) < 0) {
umask(old_umask);
virReportError(VIR_ERR_OPERATION_FAILED,
_("Failed to create state dir '%s'"),
{
unsigned int free_mem;
- if (virFileMakePath(cfg->logDir) < 0) {
+ if (g_mkdir_with_parents(cfg->logDir, 0777) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("failed to create log dir '%s': %s"),
cfg->logDir,
libxl_event_register_callbacks(cfg->ctx, &ev_hooks, libxl_driver);
libxl_driver->config = cfg;
- if (virFileMakePath(cfg->stateDir) < 0) {
+ if (g_mkdir_with_parents(cfg->stateDir, 0777) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("failed to create state dir '%s': %s"),
cfg->stateDir,
g_strerror(errno));
goto error;
}
- if (virFileMakePath(cfg->libDir) < 0) {
+ if (g_mkdir_with_parents(cfg->libDir, 0777) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("failed to create lib dir '%s': %s"),
cfg->libDir,
g_strerror(errno));
goto error;
}
- if (virFileMakePath(cfg->saveDir) < 0) {
+ if (g_mkdir_with_parents(cfg->saveDir, 0777) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("failed to create save dir '%s': %s"),
cfg->saveDir,
g_strerror(errno));
goto error;
}
- if (virFileMakePath(cfg->autoDumpDir) < 0) {
+ if (g_mkdir_with_parents(cfg->autoDumpDir, 0777) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("failed to create dump dir '%s': %s"),
cfg->autoDumpDir,
g_strerror(errno));
goto error;
}
- if (virFileMakePath(cfg->channelDir) < 0) {
+ if (g_mkdir_with_parents(cfg->channelDir, 0777) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("failed to create channel dir '%s': %s"),
cfg->channelDir,
goto endjob;
if (autostart) {
- if (virFileMakePath(cfg->autostartDir) < 0) {
+ if (g_mkdir_with_parents(cfg->autostartDir, 0777) < 0) {
virReportSystemError(errno,
_("cannot create autostart directory %s"),
cfg->autostartDir);
rundir = virGetUserRuntimeDirectory();
old_umask = umask(077);
- if (virFileMakePath(rundir) < 0) {
+ if (g_mkdir_with_parents(rundir, 0777) < 0) {
umask(old_umask);
return -1;
}
else
old_umask = umask(077);
VIR_DEBUG("Ensuring run dir '%s' exists", run_dir);
- if (virFileMakePath(run_dir) < 0) {
+ if (g_mkdir_with_parents(run_dir, 0777) < 0) {
VIR_ERROR(_("unable to create rundir %s: %s"), run_dir,
g_strerror(errno));
ret = VIR_DAEMON_ERR_RUNDIR;
rundir = virGetUserRuntimeDirectory();
old_umask = umask(077);
- if (virFileMakePath(rundir) < 0) {
+ if (g_mkdir_with_parents(rundir, 0777) < 0) {
umask(old_umask);
return -1;
}
else
old_umask = umask(077);
VIR_DEBUG("Ensuring run dir '%s' exists", run_dir);
- if (virFileMakePath(run_dir) < 0) {
+ if (g_mkdir_with_parents(run_dir, 0777) < 0) {
VIR_ERROR(_("unable to create rundir %s: %s"), run_dir,
g_strerror(errno));
ret = VIR_DAEMON_ERR_RUNDIR;
oldroot = g_strdup_printf("%s/.oldroot", root->src->path);
- if (virFileMakePath(oldroot) < 0) {
+ if (g_mkdir_with_parents(oldroot, 0777) < 0) {
virReportSystemError(errno,
_("Failed to create %s"),
oldroot);
/* Create a directory called 'new' in tmpfs */
newroot = g_strdup_printf("%s/new", oldroot);
- if (virFileMakePath(newroot) < 0) {
+ if (g_mkdir_with_parents(newroot, 0777) < 0) {
virReportSystemError(errno,
_("Failed to create %s"),
newroot);
continue;
}
- if (virFileMakePath(mnt->dst) < 0) {
+ if (g_mkdir_with_parents(mnt->dst, 0777) < 0) {
virReportSystemError(errno,
_("Failed to mkdir %s"),
mnt->dst);
path = g_strdup_printf("/.oldroot/%s/%s.dev", stateDir, def->name);
- if (virFileMakePath("/dev") < 0) {
+ if (g_mkdir_with_parents("/dev", 0777) < 0) {
virReportSystemError(errno, "%s",
_("Cannot create /dev"));
return -1;
path = g_strdup_printf("/.oldroot/%s/%s.devpts", stateDir, def->name);
- if (virFileMakePath("/dev/pts") < 0) {
+ if (g_mkdir_with_parents("/dev/pts", 0777) < 0) {
virReportSystemError(errno, "%s",
_("Cannot create /dev/pts"));
return -1;
return -1;
}
if (S_ISDIR(st.st_mode)) {
- if (virFileMakePath(fs->dst) < 0) {
+ if (g_mkdir_with_parents(fs->dst, 0777) < 0) {
virReportSystemError(errno,
_("Failed to create %s"),
fs->dst);
if (fs->readonly)
fsflags |= MS_RDONLY;
- if (virFileMakePath(fs->dst) < 0) {
+ if (g_mkdir_with_parents(fs->dst, 0777) < 0) {
virReportSystemError(errno,
_("Failed to create %s"),
fs->dst);
data = g_strdup_printf("size=%lld%s", fs->usage, sec_mount_options);
- if (virFileMakePath(fs->dst) < 0) {
+ if (g_mkdir_with_parents(fs->dst, 0777) < 0) {
virReportSystemError(errno,
_("Failed to create %s"),
fs->dst);
if ((tmp = strrchr(dir, '/'))) {
*tmp = '\0';
- if (virFileMakePath(dir) < 0) {
+ if (g_mkdir_with_parents(dir, 0777) < 0) {
virReportSystemError(errno,
_("Failed to create directory for '%s' dev '%s'"),
dir, dev);
mode = 0700 | S_IFCHR;
- if (virFileMakePath(dstdir) < 0) {
+ if (g_mkdir_with_parents(dstdir, 0777) < 0) {
virReportSystemError(errno,
_("Unable to create %s"), dstdir);
return -1;
devpts = g_strdup_printf("%s/%s.devpts", LXC_STATE_DIR, ctrl->def->name);
ctrl->devptmx = g_strdup_printf("%s/%s.devpts/ptmx", LXC_STATE_DIR, ctrl->def->name);
- if (virFileMakePath(devpts) < 0) {
+ if (g_mkdir_with_parents(devpts, 0777) < 0) {
virReportSystemError(errno,
_("Failed to make path %s"),
devpts);
if (!(lxc_driver->closeCallbacks = virCloseCallbacksNew()))
goto cleanup;
- if (virFileMakePath(cfg->stateDir) < 0) {
+ if (g_mkdir_with_parents(cfg->stateDir, 0777) < 0) {
virReportSystemError(errno,
_("Failed to mkdir %s"),
cfg->stateDir);
goto endjob;
if (autostart) {
- if (virFileMakePath(cfg->autostartDir) < 0) {
+ if (g_mkdir_with_parents(cfg->autostartDir, 0777) < 0) {
virReportSystemError(errno,
_("Cannot create autostart directory %s"),
cfg->autostartDir);
fuse->mountpoint = g_strdup_printf("%s/%s.fuse/", LXC_STATE_DIR, def->name);
- if (virFileMakePath(fuse->mountpoint) < 0) {
+ if (g_mkdir_with_parents(fuse->mountpoint, 0777) < 0) {
virReportSystemError(errno, _("Cannot create %s"),
fuse->mountpoint);
goto cleanup1;
}
}
- if (virFileMakePath(cfg->logDir) < 0) {
+ if (g_mkdir_with_parents(cfg->logDir, 0777) < 0) {
virReportSystemError(errno,
_("Cannot create log directory '%s'"),
cfg->logDir);
network_driver->radvdStateDir = g_strdup_printf("%s/radvd/lib", rundir);
}
- if (virFileMakePath(network_driver->stateDir) < 0) {
+ if (g_mkdir_with_parents(network_driver->stateDir, 0777) < 0) {
virReportSystemError(errno,
_("cannot create directory %s"),
network_driver->stateDir);
if (!needDnsmasq && def->dns.enable == VIR_TRISTATE_BOOL_NO)
return 0;
- if (virFileMakePath(driver->pidDir) < 0) {
+ if (g_mkdir_with_parents(driver->pidDir, 0777) < 0) {
virReportSystemError(errno,
_("cannot create directory %s"),
driver->pidDir);
if (!(pidfile = virPidFileBuildPath(driver->pidDir, def->name)))
return -1;
- if (virFileMakePath(driver->dnsmasqStateDir) < 0) {
+ if (g_mkdir_with_parents(driver->dnsmasqStateDir, 0777) < 0) {
virReportSystemError(errno,
_("cannot create directory %s"),
driver->dnsmasqStateDir);
return -1;
}
- if (virFileMakePath(driver->pidDir) < 0) {
+ if (g_mkdir_with_parents(driver->pidDir, 0777) < 0) {
virReportSystemError(errno,
_("cannot create directory %s"),
driver->pidDir);
return -1;
}
- if (virFileMakePath(driver->radvdStateDir) < 0) {
+ if (g_mkdir_with_parents(driver->radvdStateDir, 0777) < 0) {
virReportSystemError(errno,
_("cannot create directory %s"),
driver->radvdStateDir);
goto cleanup;
if (new_autostart) {
- if (virFileMakePath(driver->networkAutostartDir) < 0) {
+ if (g_mkdir_with_parents(driver->networkAutostartDir, 0777) < 0) {
virReportSystemError(errno,
_("cannot create autostart directory '%s'"),
driver->networkAutostartDir);
return -1;
chkDir = g_strdup_printf("%s/%s", checkpointDir, vm->def->name);
- if (virFileMakePath(chkDir) < 0) {
+ if (g_mkdir_with_parents(chkDir, 0777) < 0) {
virReportSystemError(errno, _("cannot create checkpoint directory '%s'"),
chkDir);
return -1;
return -1;
snapDir = g_strdup_printf("%s/%s", snapshotDir, vm->def->name);
- if (virFileMakePath(snapDir) < 0) {
+ if (g_mkdir_with_parents(snapDir, 0777) < 0) {
virReportSystemError(errno, _("cannot create snapshot directory '%s'"),
snapDir);
return -1;
if (virQEMUDriverConfigSetDefaults(cfg) < 0)
goto error;
- if (virFileMakePath(cfg->stateDir) < 0) {
+ if (g_mkdir_with_parents(cfg->stateDir, 0777) < 0) {
virReportSystemError(errno, _("Failed to create state dir %s"),
cfg->stateDir);
goto error;
}
- if (virFileMakePath(cfg->libDir) < 0) {
+ if (g_mkdir_with_parents(cfg->libDir, 0777) < 0) {
virReportSystemError(errno, _("Failed to create lib dir %s"),
cfg->libDir);
goto error;
}
- if (virFileMakePath(cfg->cacheDir) < 0) {
+ if (g_mkdir_with_parents(cfg->cacheDir, 0777) < 0) {
virReportSystemError(errno, _("Failed to create cache dir %s"),
cfg->cacheDir);
goto error;
}
- if (virFileMakePath(cfg->saveDir) < 0) {
+ if (g_mkdir_with_parents(cfg->saveDir, 0777) < 0) {
virReportSystemError(errno, _("Failed to create save dir %s"),
cfg->saveDir);
goto error;
}
- if (virFileMakePath(cfg->snapshotDir) < 0) {
+ if (g_mkdir_with_parents(cfg->snapshotDir, 0777) < 0) {
virReportSystemError(errno, _("Failed to create snapshot dir %s"),
cfg->snapshotDir);
goto error;
}
- if (virFileMakePath(cfg->checkpointDir) < 0) {
+ if (g_mkdir_with_parents(cfg->checkpointDir, 0777) < 0) {
virReportSystemError(errno, _("Failed to create checkpoint dir %s"),
cfg->checkpointDir);
goto error;
}
- if (virFileMakePath(cfg->autoDumpPath) < 0) {
+ if (g_mkdir_with_parents(cfg->autoDumpPath, 0777) < 0) {
virReportSystemError(errno, _("Failed to create dump dir %s"),
cfg->autoDumpPath);
goto error;
}
- if (virFileMakePath(cfg->channelTargetDir) < 0) {
+ if (g_mkdir_with_parents(cfg->channelTargetDir, 0777) < 0) {
virReportSystemError(errno, _("Failed to create channel target dir %s"),
cfg->channelTargetDir);
goto error;
}
- if (virFileMakePath(cfg->nvramDir) < 0) {
+ if (g_mkdir_with_parents(cfg->nvramDir, 0777) < 0) {
virReportSystemError(errno, _("Failed to create nvram dir %s"),
cfg->nvramDir);
goto error;
}
- if (virFileMakePath(cfg->memoryBackingDir) < 0) {
+ if (g_mkdir_with_parents(cfg->memoryBackingDir, 0777) < 0) {
virReportSystemError(errno, _("Failed to create memory backing dir %s"),
cfg->memoryBackingDir);
goto error;
}
- if (virFileMakePath(cfg->slirpStateDir) < 0) {
+ if (g_mkdir_with_parents(cfg->slirpStateDir, 0777) < 0) {
virReportSystemError(errno, _("Failed to create slirp state dir %s"),
cfg->slirpStateDir);
goto error;
if (!hugepagePath)
goto error;
- if (virFileMakePath(hugepagePath) < 0) {
+ if (g_mkdir_with_parents(hugepagePath, 0777) < 0) {
virReportSystemError(errno,
_("unable to create hugepage path %s"),
hugepagePath);
goto endjob;
if (autostart) {
- if (virFileMakePath(cfg->autostartDir) < 0) {
+ if (g_mkdir_with_parents(cfg->autostartDir, 0777) < 0) {
virReportSystemError(errno,
_("cannot create autostart directory %s"),
cfg->autostartDir);
/* At this point, devMountsPath is either:
* a file (regular or special), or
* a directory. */
- if ((S_ISDIR(sb.st_mode) && virFileMakePath(devMountsSavePath[i]) < 0) ||
+ if ((S_ISDIR(sb.st_mode) && g_mkdir_with_parents(devMountsSavePath[i], 0777) < 0) ||
(!S_ISDIR(sb.st_mode) && virFileTouch(devMountsSavePath[i], sb.st_mode) < 0)) {
virReportSystemError(errno,
_("Failed to create %s"),
}
if (S_ISDIR(sb.st_mode)) {
- if (virFileMakePath(devMountsPath[i]) < 0) {
+ if (g_mkdir_with_parents(devMountsPath[i], 0777) < 0) {
virReportSystemError(errno, _("Cannot create %s"),
devMountsPath[i]);
goto cleanup;
VIR_DEBUG("Ensuring no historical cgroup is lying around");
qemuRemoveCgroup(vm);
- if (virFileMakePath(cfg->logDir) < 0) {
+ if (g_mkdir_with_parents(cfg->logDir, 0777) < 0) {
virReportSystemError(errno,
_("cannot create log directory %s"),
cfg->logDir);
else
old_umask = umask(077);
VIR_DEBUG("Ensuring run dir '%s' exists", run_dir);
- if (virFileMakePath(run_dir) < 0) {
+ if (g_mkdir_with_parents(run_dir, 0777) < 0) {
VIR_ERROR(_("unable to create rundir %s: %s"), run_dir,
g_strerror(errno));
ret = VIR_DAEMON_ERR_RUNDIR;
}
driver->privileged = privileged;
- if (virFileMakePath(driver->stateDir) < 0) {
+ if (g_mkdir_with_parents(driver->stateDir, 0777) < 0) {
virReportError(errno,
_("cannot create directory %s"),
driver->stateDir);
cur_autostart = virStoragePoolObjIsAutostart(obj);
if (cur_autostart != new_autostart) {
if (new_autostart) {
- if (virFileMakePath(driver->autostartDir) < 0) {
+ if (g_mkdir_with_parents(driver->autostartDir, 0777) < 0) {
virReportSystemError(errno,
_("cannot create autostart directory %s"),
driver->autostartDir);
/* assure all directories in the path prior to the final dir
* exist, with default uid/gid/mode. */
*p = '\0';
- if (virFileMakePath(parent) < 0) {
+ if (g_mkdir_with_parents(parent, 0777) < 0) {
virReportSystemError(errno, _("cannot create path '%s'"),
parent);
return -1;
VIR_DEBUG("Mounting cgroups at '%s'", root);
- if (virFileMakePath(root) < 0) {
+ if (g_mkdir_with_parents(root, 0777) < 0) {
virReportSystemError(errno,
_("Unable to create directory %s"),
root);
VIR_DEBUG("Create mount point '%s'",
group->legacy[i].mountPoint);
- if (virFileMakePath(group->legacy[i].mountPoint) < 0) {
+ if (g_mkdir_with_parents(group->legacy[i].mountPoint, 0777) < 0) {
virReportSystemError(errno,
_("Unable to create directory %s"),
group->legacy[i].mountPoint);
VIR_DEBUG("Mounting cgroups at '%s'", group->unified.mountPoint);
- if (virFileMakePath(group->unified.mountPoint) < 0) {
+ if (g_mkdir_with_parents(group->unified.mountPoint, 0777) < 0) {
virReportSystemError(errno, _("Unable to create directory %s"),
group->unified.mountPoint);
return -1;
rundir = virGetUserRuntimeDirectory();
old_umask = umask(077);
- if (virFileMakePath(rundir) < 0) {
+ if (g_mkdir_with_parents(rundir, 0777) < 0) {
umask(old_umask);
goto cleanup;
}
{
int ret = 0;
- if (virFileMakePath(ctx->config_dir) < 0) {
+ if (g_mkdir_with_parents(ctx->config_dir, 0777) < 0) {
virReportSystemError(errno, _("cannot create config directory '%s'"),
ctx->config_dir);
return -1;
const unsigned long mount_flags = MS_NOSUID;
const char *mount_fs = "tmpfs";
- if (virFileMakePath(path) < 0) {
+ if (g_mkdir_with_parents(path, 0777) < 0) {
virReportSystemError(errno,
_("Failed to make path %s"), path);
return -1;
{
if (!virFileExists(dst)) {
if (virFileIsDir(src)) {
- if (virFileMakePath(dst) < 0) {
+ if (g_mkdir_with_parents(dst, 0777) < 0) {
virReportSystemError(errno, _("Unable to make dir %s"), dst);
return -1;
}
if (virCryptoHashString(VIR_CRYPTO_HASH_SHA256, name, &namehash) < 0)
return NULL;
- if (virFileMakePath(cache->dir) < 0) {
+ if (g_mkdir_with_parents(cache->dir, 0777) < 0) {
virReportSystemError(errno,
_("Unable to create directory '%s'"),
cache->dir);
logdir = virGetUserCacheDirectory();
old_umask = umask(077);
- if (virFileMakePath(logdir) < 0) {
+ if (g_mkdir_with_parents(logdir, 0777) < 0) {
umask(old_umask);
return -1;
}
if (name == NULL || dir == NULL)
return -EINVAL;
- if (virFileMakePath(dir) < 0)
+ if (g_mkdir_with_parents(dir, 0777) < 0)
return -errno;
if (!(pidfile = virPidFileBuildPath(dir, name)))
if (virFileExists(path))
return 0;
- if (virFileMakePath(path) < 0) {
+ if (g_mkdir_with_parents(path, 0777) < 0) {
virReportSystemError(errno,
_("Cannot create resctrl directory '%s'"),
path);
char *path = NULL;
path = g_strdup_printf("%s/securityselinuxlabeldata/testxattr", abs_builddir);
- if (virFileMakePath(abs_builddir "/securityselinuxlabeldata") < 0 ||
+ if (g_mkdir_with_parents(abs_builddir "/securityselinuxlabeldata", 0777) < 0 ||
virFileTouch(path, 0600) < 0)
goto cleanup;
{
size_t i;
- if (virFileMakePath(abs_builddir "/securityselinuxlabeldata/nfs") < 0)
+ if (g_mkdir_with_parents(abs_builddir "/securityselinuxlabeldata/nfs", 0777) < 0)
return -1;
for (i = 0; i < nfiles; i++) {
pathResult = g_strdup(abs_builddir "/vboxsnapshotxmldata/testResult.vbox");
- if (virFileMakePath(abs_builddir "/vboxsnapshotxmldata") < 0)
+ if (g_mkdir_with_parents(abs_builddir "/vboxsnapshotxmldata", 0777) < 0)
goto cleanup;
if (virTestLoadFile(xml, &xmlData) < 0)
fakesysfscgroupdir = g_strdup_printf("%s%s",
fakerootdir, SYSFS_CGROUP_PREFIX);
- if (virFileMakePath(fakesysfscgroupdir) < 0) {
+ if (g_mkdir_with_parents(fakesysfscgroupdir, 0777) < 0) {
fprintf(stderr, "Cannot create %s\n", fakesysfscgroupdir);
abort();
}
if ((mgr->activeNVMeHostdevs = virNVMeDeviceListNew()) == NULL)
goto cleanup;
mgr->stateDir = g_strdup(TEST_STATE_DIR);
- if (virFileMakePath(mgr->stateDir) < 0)
+ if (g_mkdir_with_parents(mgr->stateDir, 0777) < 0)
goto cleanup;
return 0;
dirpath = g_strdup_printf("%s/%s", path, name);
- if (virFileMakePath(dirpath) < 0)
+ if (g_mkdir_with_parents(dirpath, 0777) < 0)
ABORT("Unable to create: %s", dirpath);
}
iommuPath = g_strdup_printf("%s/sys/kernel/iommu_groups/%d/devices/",
fakerootdir, dev->iommuGroup);
- if (virFileMakePath(iommuPath) < 0)
+ if (g_mkdir_with_parents(iommuPath, 0777) < 0)
ABORT("Unable to create: %s", iommuPath);
if (g_snprintf(tmp, sizeof(tmp),
if (!(devpath = pci_device_get_path(dev, NULL, true)))
ABORT_OOM();
- if (virFileMakePath(devpath) < 0)
+ if (g_mkdir_with_parents(devpath, 0777) < 0)
ABORT("Unable to create: %s", devpath);
if (stat(configSrc, &sb) == 0)
if (!(driverpath = pci_driver_get_path(driver, NULL, true)))
ABORT_OOM();
- if (virFileMakePath(driverpath) < 0)
+ if (g_mkdir_with_parents(driverpath, 0777) < 0)
ABORT("Unable to create: %s", driverpath);
va_start(args, name);
tmp = g_strdup_printf("%s%s", fakerootdir, SYSFS_PCI_PREFIX);
- if (virFileMakePath(tmp) < 0)
+ if (g_mkdir_with_parents(tmp, 0777) < 0)
ABORT("Unable to create: %s", tmp);
make_dir(tmp, "devices");
VIR_FREE(tmp);
tmp = g_strdup_printf("%s/dev/vfio", fakerootdir);
- if (virFileMakePath(tmp) < 0)
+ if (g_mkdir_with_parents(tmp, 0777) < 0)
ABORT("Unable to create: %s", tmp);
make_file(tmp, "vfio", NULL, -1);
absdir = g_strdup_printf("%s/dir", datadir);
abslink2 = g_strdup_printf("%s/sub/link2", datadir);
- if (virFileMakePath(datadir "/sub") < 0) {
+ if (g_mkdir_with_parents(datadir "/sub", 0777) < 0) {
fprintf(stderr, "unable to create directory %s\n", datadir "/sub");
goto cleanup;
}
- if (virFileMakePath(datadir "/dir") < 0) {
+ if (g_mkdir_with_parents(datadir "/dir", 0777) < 0) {
fprintf(stderr, "unable to create directory %s\n", datadir "/dir");
goto cleanup;
}