* sub/link2: symlink to wrap
*
* Relative names to these files are known at compile time, but absolute
- * and canonical names depend on where the test is run; for convenience,
+ * names depend on where the test is run; for convenience,
* we pre-populate the computation of these names for use during the test.
*/
static char *qemuimg;
static char *absraw;
-static char *canonraw;
static char *absqcow2;
-static char *canonqcow2;
static char *abswrap;
-static char *canonwrap;
static char *absqed;
-static char *canonqed;
static char *absdir;
-static char *canondir;
static char *abslink2;
static void
{
VIR_FREE(qemuimg);
VIR_FREE(absraw);
- VIR_FREE(canonraw);
VIR_FREE(absqcow2);
- VIR_FREE(canonqcow2);
VIR_FREE(abswrap);
- VIR_FREE(canonwrap);
VIR_FREE(absqed);
- VIR_FREE(canonqed);
VIR_FREE(absdir);
- VIR_FREE(canondir);
VIR_FREE(abslink2);
if (chdir(abs_builddir) < 0) {
fprintf(stderr, "unable to create directory %s\n", datadir "/dir");
goto cleanup;
}
- if (!(canondir = virFileCanonicalizePath(absdir))) {
- virReportOOMError();
- goto cleanup;
- }
if (chdir(datadir) < 0) {
fprintf(stderr, "unable to test relative backing chains\n");
fprintf(stderr, "unable to create raw file\n");
goto cleanup;
}
- if (!(canonraw = virFileCanonicalizePath(absraw))) {
- virReportOOMError();
- goto cleanup;
- }
/* Create a qcow2 wrapping relative raw; later on, we modify its
* metadata to test other configurations */
"-F", "raw", "-b", "raw", "qcow2", NULL);
if (virCommandRun(cmd, NULL) < 0)
goto skip;
- if (!(canonqcow2 = virFileCanonicalizePath(absqcow2))) {
- virReportOOMError();
- goto cleanup;
- }
/* Create a second qcow2 wrapping the first, to be sure that we
* can correctly avoid insecure probing. */
virCommandAddArg(cmd, "wrap");
if (virCommandRun(cmd, NULL) < 0)
goto skip;
- if (!(canonwrap = virFileCanonicalizePath(abswrap))) {
- virReportOOMError();
- goto cleanup;
- }
/* Create a qed file. */
virCommandFree(cmd);
virCommandAddArg(cmd, "qed");
if (virCommandRun(cmd, NULL) < 0)
goto skip;
- if (!(canonqed = virFileCanonicalizePath(absqed))) {
- virReportOOMError();
- goto cleanup;
- }
#ifdef HAVE_SYMLINK
/* Create some symlinks in a sub-directory. */
/* Raw image, whether with right format or no specified format */
testFileData raw = {
- .path = canonraw,
+ .path = absraw,
.type = VIR_STORAGE_TYPE_FILE,
.format = VIR_STORAGE_FILE_RAW,
};
testFileData qcow2 = {
.expBackingStoreRaw = "raw",
.expCapacity = 1024,
- .path = canonqcow2,
+ .path = absqcow2,
.type = VIR_STORAGE_TYPE_FILE,
.format = VIR_STORAGE_FILE_QCOW2,
};
testFileData qcow2_as_raw = {
- .path = canonqcow2,
+ .path = absqcow2,
.type = VIR_STORAGE_TYPE_FILE,
.format = VIR_STORAGE_FILE_RAW,
};
testFileData wrap = {
.expBackingStoreRaw = absqcow2,
.expCapacity = 1024,
- .path = canonwrap,
+ .path = abswrap,
.type = VIR_STORAGE_TYPE_FILE,
.format = VIR_STORAGE_FILE_QCOW2,
};
testFileData wrap_as_raw = {
.expBackingStoreRaw = absqcow2,
.expCapacity = 1024,
- .path = canonwrap,
+ .path = abswrap,
.type = VIR_STORAGE_TYPE_FILE,
.format = VIR_STORAGE_FILE_QCOW2,
};
testFileData qed = {
.expBackingStoreRaw = absraw,
.expCapacity = 1024,
- .path = canonqed,
+ .path = absqed,
.type = VIR_STORAGE_TYPE_FILE,
.format = VIR_STORAGE_FILE_QED,
};
testFileData qed_as_raw = {
- .path = canonqed,
+ .path = absqed,
.type = VIR_STORAGE_TYPE_FILE,
.format = VIR_STORAGE_FILE_RAW,
};
/* directory */
testFileData dir = {
- .path = canondir,
+ .path = absdir,
.type = VIR_STORAGE_TYPE_DIR,
.format = VIR_STORAGE_FILE_DIR,
};
testFileData dir_as_raw = {
- .path = canondir,
+ .path = absdir,
.type = VIR_STORAGE_TYPE_DIR,
.format = VIR_STORAGE_FILE_RAW,
};