From: John Ferlan Date: Tue, 12 Feb 2019 12:04:42 +0000 (-0500) Subject: conf: Remove @name in virStoragePoolDefParseSource X-Git-Tag: v5.1.0-rc1~127 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c75e615d3ed1e26cfa9b0e332d6137e2ef575860;p=thirdparty%2Flibvirt.git conf: Remove @name in virStoragePoolDefParseSource Remove the need for the @name variable by directly assigning into source->hosts[i].name. Signed-off-by: John Ferlan Reviewed-by: Erik Skultety --- diff --git a/src/conf/storage_conf.c b/src/conf/storage_conf.c index 177ea63076..58c28a2d57 100644 --- a/src/conf/storage_conf.c +++ b/src/conf/storage_conf.c @@ -458,7 +458,6 @@ virStoragePoolDefParseSource(xmlXPathContextPtr ctxt, int nsource; size_t i; virStoragePoolOptionsPtr options; - char *name = NULL; char *port = NULL; char *ver = NULL; int n; @@ -502,13 +501,12 @@ virStoragePoolDefParseSource(xmlXPathContextPtr ctxt, source->nhost = n; for (i = 0; i < source->nhost; i++) { - name = virXMLPropString(nodeset[i], "name"); - if (name == NULL) { + source->hosts[i].name = virXMLPropString(nodeset[i], "name"); + if (!source->hosts[i].name) { virReportError(VIR_ERR_XML_ERROR, "%s", _("missing storage pool host name")); goto cleanup; } - source->hosts[i].name = name; port = virXMLPropString(nodeset[i], "port"); if (port) {