From: Matthias Bolte Date: Wed, 8 Sep 2010 19:46:15 +0000 (+0200) Subject: test: Don't overwrite storage volume target path and key X-Git-Tag: v0.8.4~11 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8eac26214dbe3209e9790ea2f8057d71f437b887;p=thirdparty%2Flibvirt.git 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. --- diff --git a/src/test/test_driver.c b/src/test/test_driver.c index 6c06cbc273..9d223392f2 100644 --- a/src/test/test_driver.c +++ b/src/test/test_driver.c @@ -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;