virStorageFileBackendFsPrivPtr priv = src->drv->priv;
if (!priv->canonpath) {
- if (!(priv->canonpath = canonicalize_file_name(src->path))) {
+ if (!(priv->canonpath = virFileCanonicalizePath(src->path))) {
virReportSystemError(errno, _("can't canonicalize path '%s'"),
src->path);
return NULL;
return VIR_STRDUP_QUIET(*resultpath, linkpath) < 0 ? -1 : 0;
}
- *resultpath = canonicalize_file_name(linkpath);
+ *resultpath = virFileCanonicalizePath(linkpath);
return *resultpath == NULL ? -1 : 0;
}
return NULL;
}
- device_path = canonicalize_file_name(device_link);
+ device_path = virFileCanonicalizePath(device_link);
if (device_path == NULL) {
virReportSystemError(errno,
_("Failed to resolve device link '%s'"),
fprintf(stderr, "unable to create directory %s\n", datadir "/dir");
goto cleanup;
}
- if (!(canondir = canonicalize_file_name(absdir))) {
+ if (!(canondir = virFileCanonicalizePath(absdir))) {
virReportOOMError();
goto cleanup;
}
fprintf(stderr, "unable to create raw file\n");
goto cleanup;
}
- if (!(canonraw = canonicalize_file_name(absraw))) {
+ if (!(canonraw = virFileCanonicalizePath(absraw))) {
virReportOOMError();
goto cleanup;
}
"-F", "raw", "-b", "raw", "qcow2", NULL);
if (virCommandRun(cmd, NULL) < 0)
goto skip;
- if (!(canonqcow2 = canonicalize_file_name(absqcow2))) {
+ if (!(canonqcow2 = virFileCanonicalizePath(absqcow2))) {
virReportOOMError();
goto cleanup;
}
virCommandAddArg(cmd, "wrap");
if (virCommandRun(cmd, NULL) < 0)
goto skip;
- if (!(canonwrap = canonicalize_file_name(abswrap))) {
+ if (!(canonwrap = virFileCanonicalizePath(abswrap))) {
virReportOOMError();
goto cleanup;
}
virCommandAddArg(cmd, "qed");
if (virCommandRun(cmd, NULL) < 0)
goto skip;
- if (!(canonqed = canonicalize_file_name(absqed))) {
+ if (!(canonqed = virFileCanonicalizePath(absqed))) {
virReportOOMError();
goto cleanup;
}
virAsprintfQuiet(&relPath, "./%s", path) < 0)
goto error;
- /* Le sigh. Both canonicalize_file_name() and realpath()
- * expect @path to exist otherwise they return an error. So
- * if we are called over an non-existent file, this could
- * return an error. In that case do our best and hope we will
- * catch possible error. */
- if ((fullPath = canonicalize_file_name(relPath ? relPath : path))) {
+ /* Le sigh. virFileCanonicalizePath() expects @path to exist, otherwise
+ * it will return an error. So if we are called over an non-existent
+ * file, this could return an error. In that case do our best and hope
+ * we will catch possible errors. */
+ if ((fullPath = virFileCanonicalizePath(relPath ? relPath : path))) {
path = fullPath;
} else {
/* Yeah, our worst nightmares just became true. Path does
virFileRemoveLastComponent(crippledPath);
- if ((fullPath = canonicalize_file_name(crippledPath)))
+ if ((fullPath = virFileCanonicalizePath(crippledPath)))
path = fullPath;
}