goto error;
if (virStorageIsFile(path)) {
- if (!(ret->canonPath = canonicalize_file_name(path))) {
+ if (!(ret->path = canonicalize_file_name(path))) {
virReportSystemError(errno, _("unable to resolve '%s'"), path);
goto error;
}
} else {
- if (VIR_STRDUP(ret->canonPath, path) < 0)
+ if (VIR_STRDUP(ret->path, path) < 0)
goto error;
}
* file; therefore, no inclusion loop is possible, and we
* don't need canonName or relDir. */
VIR_FREE(meta->relDir);
- VIR_FREE(meta->canonPath);
+ VIR_FREE(meta->path);
meta->type = VIR_STORAGE_TYPE_DIR;
meta->format = VIR_STORAGE_FILE_DIR;
ret = 0;
if (virStorageIsFile(path)) {
if (VIR_STRDUP(meta->relPath, path) < 0)
return -1;
- if (VIR_STRDUP(meta->canonPath, canonPath) < 0)
+ if (VIR_STRDUP(meta->path, canonPath) < 0)
return -1;
if (VIR_STRDUP(meta->relDir, directory) < 0)
return -1;
* allow for non-raw images. */
if (VIR_STRDUP(meta->relPath, path) < 0)
return -1;
- if (VIR_STRDUP(meta->canonPath, path) < 0)
+ if (VIR_STRDUP(meta->path, path) < 0)
return -1;
meta->type = VIR_STORAGE_TYPE_NETWORK;
meta->format = VIR_STORAGE_FILE_RAW;
return;
VIR_FREE(meta->relPath);
- VIR_FREE(meta->canonPath);
+ VIR_FREE(meta->path);
VIR_FREE(meta->relDir);
virStorageFileFreeMetadata(meta->backingMeta);
const char *name, virStorageFileMetadataPtr *meta,
const char **parent)
{
- const char *start = chain->canonPath;
+ const char *start = chain->path;
const char *tmp;
const char *parentDir = ".";
bool nameIsFile = virStorageIsFile(name);
if (nameIsFile && (chain->type == VIR_STORAGE_TYPE_FILE ||
chain->type == VIR_STORAGE_TYPE_BLOCK)) {
int result = virFileRelLinkPointsTo(parentDir, name,
- chain->canonPath);
+ chain->path);
if (result < 0)
goto error;
if (result > 0)
break;
}
}
- *parent = chain->canonPath;
+ *parent = chain->path;
parentDir = chain->relDir;
chain = chain->backingMeta;
}
goto error;
if (meta)
*meta = chain;
- return chain->canonPath;
+ return chain->path;
error:
if (name)
bool expEncrypted;
const char *pathRel;
const char *pathAbs;
- const char *canonPath;
+ const char *path;
const char *relDirRel;
const char *relDirAbs;
int type;
: data->files[i]->relDirRel;
if (virAsprintf(&expect,
"store:%s\nraw:%s\nother:%lld %d\n"
- "relPath:%s\ncanon:%s\nrelDir:%s\ntype:%d %d\n",
+ "relPath:%s\npath:%s\nrelDir:%s\ntype:%d %d\n",
NULLSTR(data->files[i]->expBackingStore),
NULLSTR(data->files[i]->expBackingStoreRaw),
data->files[i]->expCapacity,
data->files[i]->expEncrypted,
NULLSTR(expPath),
- NULLSTR(data->files[i]->canonPath),
+ NULLSTR(data->files[i]->path),
NULLSTR(expRelDir),
data->files[i]->type,
data->files[i]->format) < 0 ||
virAsprintf(&actual,
"store:%s\nraw:%s\nother:%lld %d\n"
- "relPath:%s\ncanon:%s\nrelDir:%s\ntype:%d %d\n",
+ "relPath:%s\npath:%s\nrelDir:%s\ntype:%d %d\n",
NULLSTR(elt->backingStore),
NULLSTR(elt->backingStoreRaw),
elt->capacity, !!elt->encryption,
NULLSTR(elt->relPath),
- NULLSTR(elt->canonPath),
+ NULLSTR(elt->path),
NULLSTR(elt->relDir),
elt->type, elt->format) < 0) {
VIR_FREE(expect);
testFileData raw = {
.pathRel = "raw",
.pathAbs = canonraw,
- .canonPath = canonraw,
+ .path = canonraw,
.relDirRel = ".",
.relDirAbs = datadir,
.type = VIR_STORAGE_TYPE_FILE,
.expCapacity = 1024,
.pathRel = "qcow2",
.pathAbs = canonqcow2,
- .canonPath = canonqcow2,
+ .path = canonqcow2,
.relDirRel = ".",
.relDirAbs = datadir,
.type = VIR_STORAGE_TYPE_FILE,
testFileData qcow2_as_raw = {
.pathRel = "qcow2",
.pathAbs = canonqcow2,
- .canonPath = canonqcow2,
+ .path = canonqcow2,
.relDirRel = ".",
.relDirAbs = datadir,
.type = VIR_STORAGE_TYPE_FILE,
.expCapacity = 1024,
.pathRel = "wrap",
.pathAbs = abswrap,
- .canonPath = canonwrap,
+ .path = canonwrap,
.relDirRel = ".",
.relDirAbs = datadir,
.type = VIR_STORAGE_TYPE_FILE,
.expCapacity = 1024,
.pathRel = "wrap",
.pathAbs = abswrap,
- .canonPath = canonwrap,
+ .path = canonwrap,
.relDirRel = ".",
.relDirAbs = datadir,
.type = VIR_STORAGE_TYPE_FILE,
testFileData nbd = {
.pathRel = "nbd:example.org:6000",
.pathAbs = "nbd:example.org:6000",
- .canonPath = "nbd:example.org:6000",
+ .path = "nbd:example.org:6000",
.type = VIR_STORAGE_TYPE_NETWORK,
.format = VIR_STORAGE_FILE_RAW,
};
.expCapacity = 1024,
.pathRel = "qed",
.pathAbs = absqed,
- .canonPath = canonqed,
+ .path = canonqed,
.relDirRel = ".",
.relDirAbs = datadir,
.type = VIR_STORAGE_TYPE_FILE,
testFileData qed_as_raw = {
.pathRel = "qed",
.pathAbs = absqed,
- .canonPath = canonqed,
+ .path = canonqed,
.relDirRel = ".",
.relDirAbs = datadir,
.type = VIR_STORAGE_TYPE_FILE,
.expCapacity = 1024,
.pathRel = "../sub/link1",
.pathAbs = "../sub/link1",
- .canonPath = canonqcow2,
+ .path = canonqcow2,
.relDirRel = "sub/../sub",
.relDirAbs = datadir "/sub/../sub",
.type = VIR_STORAGE_TYPE_FILE,
.expCapacity = 1024,
.pathRel = "sub/link2",
.pathAbs = abslink2,
- .canonPath = canonwrap,
+ .path = canonwrap,
.relDirRel = "sub",
.relDirAbs = datadir "/sub",
.type = VIR_STORAGE_TYPE_FILE,
} while (0)
TEST_LOOKUP(0, "bogus", NULL, NULL, NULL);
- TEST_LOOKUP(1, "wrap", chain->canonPath, chain, NULL);
- TEST_LOOKUP(2, abswrap, chain->canonPath, chain, NULL);
+ TEST_LOOKUP(1, "wrap", chain->path, chain, NULL);
+ TEST_LOOKUP(2, abswrap, chain->path, chain, NULL);
TEST_LOOKUP(3, "qcow2", chain->backingStore, chain->backingMeta,
- chain->canonPath);
+ chain->path);
TEST_LOOKUP(4, absqcow2, chain->backingStore, chain->backingMeta,
- chain->canonPath);
+ chain->path);
TEST_LOOKUP(5, "raw", chain->backingMeta->backingStore,
chain->backingMeta->backingMeta, chain->backingStore);
TEST_LOOKUP(6, absraw, chain->backingMeta->backingStore,
}
TEST_LOOKUP(8, "bogus", NULL, NULL, NULL);
- TEST_LOOKUP(9, "wrap", chain->canonPath, chain, NULL);
- TEST_LOOKUP(10, abswrap, chain->canonPath, chain, NULL);
+ TEST_LOOKUP(9, "wrap", chain->path, chain, NULL);
+ TEST_LOOKUP(10, abswrap, chain->path, chain, NULL);
TEST_LOOKUP(11, "qcow2", chain->backingStore, chain->backingMeta,
- chain->canonPath);
+ chain->path);
TEST_LOOKUP(12, absqcow2, chain->backingStore, chain->backingMeta,
- chain->canonPath);
+ chain->path);
TEST_LOOKUP(13, "raw", chain->backingMeta->backingStore,
chain->backingMeta->backingMeta, chain->backingStore);
TEST_LOOKUP(14, absraw, chain->backingMeta->backingStore,
}
TEST_LOOKUP(16, "bogus", NULL, NULL, NULL);
- TEST_LOOKUP(17, "sub/link2", chain->canonPath, chain, NULL);
- TEST_LOOKUP(18, "wrap", chain->canonPath, chain, NULL);
- TEST_LOOKUP(19, abswrap, chain->canonPath, chain, NULL);
+ TEST_LOOKUP(17, "sub/link2", chain->path, chain, NULL);
+ TEST_LOOKUP(18, "wrap", chain->path, chain, NULL);
+ TEST_LOOKUP(19, abswrap, chain->path, chain, NULL);
TEST_LOOKUP(20, "../qcow2", chain->backingStore, chain->backingMeta,
- chain->canonPath);
+ chain->path);
TEST_LOOKUP(21, "qcow2", NULL, NULL, NULL);
TEST_LOOKUP(22, absqcow2, chain->backingStore, chain->backingMeta,
- chain->canonPath);
+ chain->path);
TEST_LOOKUP(23, "raw", chain->backingMeta->backingStore,
chain->backingMeta->backingMeta, chain->backingStore);
TEST_LOOKUP(24, absraw, chain->backingMeta->backingStore,