mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-22 11:22:23 +00: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:
parent
6d57950932
commit
8eac26214d
@ -706,17 +706,21 @@ static int testOpenVolumesForPool(xmlDocPtr xml,
|
||||
goto error;
|
||||
}
|
||||
|
||||
if (virAsprintf(&def->target.path, "%s/%s",
|
||||
pool->def->target.path,
|
||||
def->name) == -1) {
|
||||
virReportOOMError();
|
||||
goto error;
|
||||
if (def->target.path == NULL) {
|
||||
if (virAsprintf(&def->target.path, "%s/%s",
|
||||
pool->def->target.path,
|
||||
def->name) == -1) {
|
||||
virReportOOMError();
|
||||
goto error;
|
||||
}
|
||||
}
|
||||
|
||||
def->key = strdup(def->target.path);
|
||||
if (def->key == NULL) {
|
||||
virReportOOMError();
|
||||
goto error;
|
||||
def->key = strdup(def->target.path);
|
||||
if (def->key == NULL) {
|
||||
virReportOOMError();
|
||||
goto error;
|
||||
}
|
||||
}
|
||||
|
||||
pool->def->allocation += def->allocation;
|
||||
|
Loading…
x
Reference in New Issue
Block a user