[libvirt] [PATCH v2 16/32] conf: Use VIR_AUTOFREE for storage_conf

Ján Tomko jtomko at redhat.com
Mon Feb 11 13:29:26 UTC 2019


On Fri, Feb 08, 2019 at 01:37:10PM -0500, John Ferlan wrote:
>Let's make use of the auto __cleanup capabilities cleaning up any
>now unnecessary goto paths.
>
>Signed-off-by: John Ferlan <jferlan at redhat.com>
>Reviewed-by: Erik Skultety <eskultet at redhat.com>
>---
> src/conf/storage_conf.c | 179 +++++++++++++++++-----------------------
> 1 file changed, 74 insertions(+), 105 deletions(-)
>
>diff --git a/src/conf/storage_conf.c b/src/conf/storage_conf.c
>index 177ea63076..a2ddecf0f2 100644
>--- a/src/conf/storage_conf.c
>+++ b/src/conf/storage_conf.c
>@@ -502,13 +502,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) {

Unrelated hunk.

To the rest:
Reviewed-by: Ján Tomko <jtomko at redhat.com>

Jano
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20190211/1b791be1/attachment-0001.sig>


More information about the libvir-list mailing list