From c75e615d3ed1e26cfa9b0e332d6137e2ef575860 Mon Sep 17 00:00:00 2001 From: John Ferlan Date: Tue, 12 Feb 2019 07:04:42 -0500 Subject: [PATCH] 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 --- src/conf/storage_conf.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) 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) {