1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2025-08-24 09:49:59 +03:00

test: Don't overwrite storage volume target path and key

Only generate target path and key when they are not defined
in the XML config.
This commit is contained in:
Matthias Bolte
2010-09-08 21:46:15 +02:00
parent 6d57950932
commit 8eac26214d

View File

@ -706,17 +706,21 @@ static int testOpenVolumesForPool(xmlDocPtr xml,
goto error; goto error;
} }
if (virAsprintf(&def->target.path, "%s/%s", if (def->target.path == NULL) {
pool->def->target.path, if (virAsprintf(&def->target.path, "%s/%s",
def->name) == -1) { pool->def->target.path,
virReportOOMError(); def->name) == -1) {
goto error; virReportOOMError();
goto error;
}
} }
def->key = strdup(def->target.path);
if (def->key == NULL) { if (def->key == NULL) {
virReportOOMError(); def->key = strdup(def->target.path);
goto error; if (def->key == NULL) {
virReportOOMError();
goto error;
}
} }
pool->def->allocation += def->allocation; pool->def->allocation += def->allocation;