提交 8eac2621 编写于 作者: M Matthias Bolte

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.
上级 6d579509
...@@ -706,17 +706,21 @@ static int testOpenVolumesForPool(xmlDocPtr xml, ...@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册