From nobody Sun Feb 8 20:23:26 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1531317538434230.269459735366; Wed, 11 Jul 2018 06:58:58 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.24]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1642287633; Wed, 11 Jul 2018 13:58:57 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D2F0A308BDB7; Wed, 11 Jul 2018 13:58:56 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 7E23918037F6; Wed, 11 Jul 2018 13:58:56 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w6BDwgp3015203 for ; Wed, 11 Jul 2018 09:58:42 -0400 Received: by smtp.corp.redhat.com (Postfix) id E4FA910FFE4D; Wed, 11 Jul 2018 13:58:41 +0000 (UTC) Received: from beluga.usersys.redhat.com (unknown [10.43.2.166]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6629910FFE4C; Wed, 11 Jul 2018 13:58:41 +0000 (UTC) From: Erik Skultety To: libvir-list@redhat.com Date: Wed, 11 Jul 2018 15:58:25 +0200 Message-Id: In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-loop: libvir-list@redhat.com Cc: Erik Skultety Subject: [libvirt] [PATCH v3 5/8] conf: Replace 'error' with 'cleanup' in virDomainHostdevDefParseXMLSubsys X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.24 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Wed, 11 Jul 2018 13:58:57 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" The exit path is the same for both success and failure, so the label should be called cleanup. Signed-off-by: Erik Skultety Reviewed-by: J=EF=BF=BDn Tomko --- src/conf/domain_conf.c | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 187a8b36a0..8deff5442f 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -7680,18 +7680,18 @@ virDomainHostdevDefParseXMLSubsys(xmlNodePtr node, virReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("unknown host device source address type '%s'= "), type); - goto error; + goto cleanup; } } else { virReportError(VIR_ERR_XML_ERROR, "%s", _("missing source address type")); - goto error; + goto cleanup; } =20 if (!(sourcenode =3D virXPathNode("./source", ctxt))) { virReportError(VIR_ERR_XML_ERROR, "%s", _("Missing element in hostdev device")); - goto error; + goto cleanup; } =20 if (def->source.subsys.type !=3D VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_USB && @@ -7699,20 +7699,20 @@ virDomainHostdevDefParseXMLSubsys(xmlNodePtr node, virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("Setting startupPolicy is only allowed for USB" " devices")); - goto error; + goto cleanup; } =20 if (sgio) { if (def->source.subsys.type !=3D VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_SC= SI) { virReportError(VIR_ERR_XML_ERROR, "%s", _("sgio is only supported for scsi host device"= )); - goto error; + goto cleanup; } =20 if ((scsisrc->sgio =3D virDomainDeviceSGIOTypeFromString(sgio)) <= =3D 0) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("unknown sgio mode '%s'"), sgio); - goto error; + goto cleanup; } } =20 @@ -7720,14 +7720,14 @@ virDomainHostdevDefParseXMLSubsys(xmlNodePtr node, if (def->source.subsys.type !=3D VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_SC= SI) { virReportError(VIR_ERR_XML_ERROR, "%s", _("rawio is only supported for scsi host device= ")); - goto error; + goto cleanup; } =20 if ((scsisrc->rawio =3D virTristateBoolTypeFromString(rawio)) <=3D= 0) { virReportError(VIR_ERR_XML_ERROR, _("unknown hostdev rawio setting '%s'"), rawio); - goto error; + goto cleanup; } } =20 @@ -7736,28 +7736,28 @@ virDomainHostdevDefParseXMLSubsys(xmlNodePtr node, virReportError(VIR_ERR_XML_ERROR, "%s", _("'model' attribute in is only suppo= rted " "when type=3D'mdev'")); - goto error; + goto cleanup; } } else { if (!model) { virReportError(VIR_ERR_XML_ERROR, "%s", _("Missing 'model' attribute in mediated device= 's " " element")); - goto error; + goto cleanup; } =20 if ((mdevsrc->model =3D virMediatedDeviceModelTypeFromString(model= )) < 0) { virReportError(VIR_ERR_XML_ERROR, _("unknown hostdev model '%s'"), model); - goto error; + goto cleanup; } } =20 switch (def->source.subsys.type) { case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI: if (virDomainHostdevSubsysPCIDefParseXML(sourcenode, def, flags) <= 0) - goto error; + goto cleanup; =20 backend =3D VIR_DOMAIN_HOSTDEV_PCI_BACKEND_DEFAULT; if ((backendStr =3D virXPathString("string(./driver/@name)", ctxt)= ) && @@ -7766,7 +7766,7 @@ virDomainHostdevDefParseXMLSubsys(xmlNodePtr node, virReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("Unknown PCI device " "has been specified"), backendStr); - goto error; + goto cleanup; } pcisrc->backend =3D backend; =20 @@ -7774,32 +7774,32 @@ virDomainHostdevDefParseXMLSubsys(xmlNodePtr node, =20 case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_USB: if (virDomainHostdevSubsysUSBDefParseXML(sourcenode, def) < 0) - goto error; + goto cleanup; break; =20 case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_SCSI: if (virDomainHostdevSubsysSCSIDefParseXML(sourcenode, scsisrc, ctx= t) < 0) - goto error; + goto cleanup; break; =20 case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_SCSI_HOST: if (virDomainHostdevSubsysSCSIVHostDefParseXML(sourcenode, def) < = 0) - goto error; + goto cleanup; break; case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_MDEV: if (virDomainHostdevSubsysMediatedDevDefParseXML(def, ctxt) < 0) - goto error; + goto cleanup; break; =20 default: virReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("address type=3D'%s' not supported in hostdev int= erfaces"), virDomainHostdevSubsysTypeToString(def->source.subs= ys.type)); - goto error; + goto cleanup; } =20 ret =3D 0; - error: + cleanup: VIR_FREE(managed); VIR_FREE(sgio); VIR_FREE(rawio); --=20 2.14.4 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list