int *backingFormat)
{
- virStorageSourcePtr ret = NULL;
- char *canonPath = NULL;
-
- if (!(canonPath = canonicalize_file_name(path))) {
- virReportSystemError(errno, _("unable to resolve '%s'"), path);
- goto cleanup;
- }
+ virStorageSourcePtr ret;
- if (!(ret = virStorageFileMetadataNew(canonPath, format)))
- goto cleanup;
+ if (!(ret = virStorageFileMetadataNew(path, format)))
+ return NULL;
if (virStorageFileGetMetadataFromFDInternal(ret, fd, backingFormat) < 0) {
virStorageSourceFree(ret);
- ret = NULL;
+ return NULL;
}
- cleanup:
- VIR_FREE(canonPath);
return ret;
}
virReportOOMError();
goto error;
}
-
- /* XXX we don't currently need to store the canonical path but the
- * change would break the test suite. Get rid of this later */
- char *tmp = ret->path;
- if (!(ret->path = canonicalize_file_name(tmp))) {
- ret->path = tmp;
- tmp = NULL;
- }
- VIR_FREE(tmp);
} else {
ret->type = VIR_STORAGE_TYPE_NETWORK;
goto error;
}
- /* XXX we don't currently need to store the canonical path but the
- * change would break the test suite. Get rid of this later */
- if (!(ret->path = canonicalize_file_name(path))) {
- if (VIR_STRDUP(ret->path, path) < 0)
- goto error;
- }
+ if (VIR_STRDUP(ret->path, path) < 0)
+ goto error;
} else {
ret->type = VIR_STORAGE_TYPE_NETWORK;
goto error;
}
- if (!(ret->path = canonicalize_file_name(path))) {
- virReportError(VIR_ERR_INTERNAL_ERROR, "failed to resolve '%s'", path);
+ if (VIR_STRDUP(ret->path, path) < 0)
goto error;
- }
if (virStorageFileGetMetadata(ret, uid, gid, allow_probe) < 0)
goto error;
.expBackingStoreRaw = "../raw",
.expCapacity = 1024,
.pathRel = "../sub/link1",
- .path = canonqcow2,
+ .path = datadir "/sub/../sub/link1",
.relDir = datadir "/sub/../sub",
.type = VIR_STORAGE_TYPE_FILE,
.format = VIR_STORAGE_FILE_QCOW2,
testFileData link2 = {
.expBackingStoreRaw = "../sub/link1",
.expCapacity = 1024,
- .path = canonwrap,
+ .path = abslink2,
.relDir = datadir "/sub",
.type = VIR_STORAGE_TYPE_FILE,
.format = VIR_STORAGE_FILE_QCOW2,
};
+
+ raw.path = datadir "/sub/../sub/../raw";
raw.pathRel = "../raw";
raw.relDir = datadir "/sub/../sub/..";
TEST_CHAIN(15, abslink2, VIR_STORAGE_FILE_QCOW2,