From nobody Mon Feb 9 17:56:09 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=gmail.com Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1637326329272520.6445189710404; Fri, 19 Nov 2021 04:52:09 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-494-FqoB-jwJOjCknIY1nop8KA-1; Fri, 19 Nov 2021 07:52:06 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 7930EA40D0; Fri, 19 Nov 2021 12:51: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 574425D740; Fri, 19 Nov 2021 12:51:57 +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 297EF1832DD4; Fri, 19 Nov 2021 12:51:57 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 1AJCmmvQ004224 for ; Fri, 19 Nov 2021 07:48:48 -0500 Received: by smtp.corp.redhat.com (Postfix) id BF68E4010FFC; Fri, 19 Nov 2021 12:48:48 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast02.extmail.prod.ext.rdu2.redhat.com [10.11.55.18]) by smtp.corp.redhat.com (Postfix) with ESMTPS id BA64640CFD02 for ; Fri, 19 Nov 2021 12:48:48 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A08B980122B for ; Fri, 19 Nov 2021 12:48:48 +0000 (UTC) Received: from mail-ua1-f51.google.com (mail-ua1-f51.google.com [209.85.222.51]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-385-sfTF3gDMOS2wf5pAsdDnXQ-1; Fri, 19 Nov 2021 07:48:46 -0500 Received: by mail-ua1-f51.google.com with SMTP id n6so21043297uak.1 for ; Fri, 19 Nov 2021 04:48:46 -0800 (PST) Received: from rekt.ibmuc.com ([152.250.208.89]) by smtp.gmail.com with ESMTPSA id s27sm1570629vkl.24.2021.11.19.04.48.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Nov 2021 04:48:46 -0800 (PST) X-MC-Unique: FqoB-jwJOjCknIY1nop8KA-1 X-MC-Unique: sfTF3gDMOS2wf5pAsdDnXQ-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=PEZH5hfTrSz3mOuuMp2OS8sASXoCmI05hsW83nkKc1U=; b=tr1FBRnFkesc0hS6fYaP8REVI4A2hnuy5je7D3gpR5WH08ZNa9eSaRQnGb4D3NkExw cToFNapiCDaQU3y0ECPQb3kaZf+L8N9CFvllMR+oIwG4dWWXgC+Z+36J/lkppTAwPTPB 6iwAmKazTz0TPXm2UoACCUQmuEle/S3h7sLdDT2i/ttynDSw3llSrQhAzI2Zsz6OxNNr 6TAP4htS+UdBO6t785ejlhfmCplQwmwPxypvZXbILTrFhjkAZdtdsFhgXhDKfXuY5v+V 4KX3IZWxRYlgNrcLtC4+WdNxOM77eh3eGCoBwgpliFZ1cNmIAYYzCgX2aImID0YGcPch RsNA== X-Gm-Message-State: AOAM532ZxHOrjDkNExa3vS1L8++exACpN/cE0+nlxChJfjzGd2yFo+Be O5jZiekDirN4kGCLT5QCDyJOnorxIo1Y3g== X-Google-Smtp-Source: ABdhPJy/zXWxHBcu4qyp12cAFVmRpP2J7Dkk2Pmyy38FCaMmz7E9ZESrAoTC5jhHc9iBdka1l5h8fg== X-Received: by 2002:a67:b643:: with SMTP id e3mr94975185vsm.33.1637326126294; Fri, 19 Nov 2021 04:48:46 -0800 (PST) From: Daniel Henrique Barboza To: libvir-list@redhat.com Subject: [PATCH v2 6/8] qemu_capabilities.c: remove cleanup label from virQEMUCapsLoadCache() Date: Fri, 19 Nov 2021 09:48:28 -0300 Message-Id: <20211119124830.569230-7-danielhb413@gmail.com> In-Reply-To: <20211119124830.569230-1-danielhb413@gmail.com> References: <20211119124830.569230-1-danielhb413@gmail.com> MIME-Version: 1.0 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 2.84 on 10.11.54.1 X-loop: libvir-list@redhat.com Cc: danielhb413@gmail.com 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: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1637326331459100001 Content-Type: text/plain; charset="utf-8" 'str' is no longer being used and the 'cleanup' label can be removed together with the 'ret' variable. Signed-off-by: Daniel Henrique Barboza --- src/qemu/qemu_capabilities.c | 42 ++++++++++++++++-------------------- 1 file changed, 18 insertions(+), 24 deletions(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 6495cb028b..9567ab7662 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -4281,17 +4281,15 @@ virQEMUCapsLoadCache(virArch hostArch, bool skipInvalidation) { g_autoptr(xmlDoc) doc =3D NULL; - int ret =3D -1; g_autoptr(xmlXPathContext) ctxt =3D NULL; - char *str =3D NULL; long long int l; unsigned long lu; =20 if (!(doc =3D virXMLParseFile(filename))) - goto cleanup; + return -1; =20 if (!(ctxt =3D virXMLXPathContextNew(doc))) - goto cleanup; + return -1; =20 ctxt->node =3D xmlDocGetRootElement(doc); =20 @@ -4300,13 +4298,13 @@ virQEMUCapsLoadCache(virArch hostArch, _("unexpected root element <%s>, " "expecting "), ctxt->node->name); - goto cleanup; + return -1; } =20 if (virXPathLongLong("string(./selfctime)", ctxt, &l) < 0) { virReportError(VIR_ERR_XML_ERROR, "%s", _("missing selfctime in QEMU capabilities XML")); - goto cleanup; + return -1; } qemuCaps->libvirtCtime =3D (time_t)l; =20 @@ -4324,17 +4322,16 @@ virQEMUCapsLoadCache(virArch hostArch, (long long)virGetSelfLastChanged(), (unsigned long)qemuCaps->libvirtVersion, (unsigned long)LIBVIR_VERSION_NUMBER); - ret =3D 1; - goto cleanup; + return 1; } =20 if (virQEMUCapsValidateEmulator(qemuCaps, ctxt) < 0) - goto cleanup; + return -1; =20 if (virXPathLongLong("string(./qemuctime)", ctxt, &l) < 0) { virReportError(VIR_ERR_XML_ERROR, "%s", _("missing qemuctime in QEMU capabilities XML")); - goto cleanup; + return -1; } qemuCaps->ctime =3D (time_t)l; =20 @@ -4342,25 +4339,25 @@ virQEMUCapsLoadCache(virArch hostArch, qemuCaps->modDirMtime =3D (time_t)l; =20 if (virQEMUCapsParseFlags(qemuCaps, ctxt) < 0) - goto cleanup; + return -1; =20 if (virXPathUInt("string(./version)", ctxt, &qemuCaps->version) < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("missing version in QEMU capabilities cache")); - goto cleanup; + return -1; } =20 if (virXPathUInt("string(./kvmVersion)", ctxt, &qemuCaps->kvmVersion) = < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("missing version in QEMU capabilities cache")); - goto cleanup; + return -1; } =20 if (virXPathUInt("string(./microcodeVersion)", ctxt, &qemuCaps->microcodeVersion) < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("missing microcode version in QEMU capabilities c= ache")); - goto cleanup; + return -1; } =20 qemuCaps->hostCPUSignature =3D virXPathString("string(./hostCPUSignatu= re)", ctxt); @@ -4374,27 +4371,27 @@ virQEMUCapsLoadCache(virArch hostArch, if (virXPathBoolean("boolean(./kernelVersion)", ctxt) > 0) { qemuCaps->kernelVersion =3D virXPathString("string(./kernelVersion= )", ctxt); if (!qemuCaps->kernelVersion) - goto cleanup; + return -1; } =20 if (virQEMUCapsValidateArch(qemuCaps, ctxt) < 0) - goto cleanup; + return -1; =20 if (virXPathBoolean("boolean(./cpudata)", ctxt) > 0) { qemuCaps->cpuData =3D virCPUDataParseNode(virXPathNode("./cpudata"= , ctxt)); if (!qemuCaps->cpuData) - goto cleanup; + return -1; } =20 if (virQEMUCapsLoadAccel(qemuCaps, ctxt, VIR_DOMAIN_VIRT_KVM) < 0 || virQEMUCapsLoadAccel(qemuCaps, ctxt, VIR_DOMAIN_VIRT_QEMU) < 0) - goto cleanup; + return -1; =20 if (virQEMUCapsParseGIC(qemuCaps, ctxt) < 0) - goto cleanup; + return -1; =20 if (virQEMUCapsParseSEVInfo(qemuCaps, ctxt) < 0) - goto cleanup; + return -1; =20 virQEMUCapsInitHostCPUModel(qemuCaps, hostArch, VIR_DOMAIN_VIRT_KVM); virQEMUCapsInitHostCPUModel(qemuCaps, hostArch, VIR_DOMAIN_VIRT_QEMU); @@ -4408,10 +4405,7 @@ virQEMUCapsLoadCache(virArch hostArch, if (skipInvalidation) qemuCaps->invalidation =3D false; =20 - ret =3D 0; - cleanup: - VIR_FREE(str); - return ret; + return 0; } =20 =20 --=20 2.31.1