On Fri, Mar 01, 2019 at 11:26:50AM -0500, John Ferlan wrote:
Now that we're using VIR_AUTOFREE there's quite a bit of clean
up
possible for now unnecessary goto paths.
Signed-off-by: John Ferlan <jferlan(a)redhat.com>
Reviewed-by: Erik Skultety <eskultet(a)redhat.com>
---
src/conf/domain_conf.c | 801 ++++++++++++++++-------------------------
1 file changed, 310 insertions(+), 491 deletions(-)
@@ -7692,7 +7659,6 @@ virDomainHostdevSubsysSCSIDefParseXML(xmlNodePtr
sourcenode,
virDomainHostdevSubsysSCSIPtr scsisrc,
xmlXPathContextPtr ctxt)
{
- int ret = -1;
VIR_AUTOFREE(char *) protocol = NULL;
if ((protocol = virXMLPropString(sourcenode, "protocol"))) {
@@ -7702,17 +7668,14 @@ virDomainHostdevSubsysSCSIDefParseXML(xmlNodePtr sourcenode,
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("Unknown SCSI subsystem protocol '%s'"),
protocol);
- goto cleanup;
+ return -1;
}
}
if (scsisrc->protocol == VIR_DOMAIN_HOSTDEV_SCSI_PROTOCOL_TYPE_ISCSI)
- ret = virDomainHostdevSubsysSCSIiSCSIDefParseXML(sourcenode, scsisrc, ctxt);
- else
- ret = virDomainHostdevSubsysSCSIHostDefParseXML(sourcenode, scsisrc);
+ return virDomainHostdevSubsysSCSIiSCSIDefParseXML(sourcenode, scsisrc, ctxt);
- cleanup:
- return ret;
+ return virDomainHostdevSubsysSCSIHostDefParseXML(sourcenode, scsisrc);
This looks odd. But having the else branch would look even more so.
}
static int
Reviewed-by: Ján Tomko <jtomko(a)redhat.com>
Jano