From nobody Tue Feb 10 01:19:59 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1629470969; cv=none; d=zohomail.com; s=zohoarc; b=jBr7RTwUt6ERWGXvXHFwhD5U9JV4jEcjjfLQolgGNTImlYcSu0hc7s/sdQeQGfZdYPAoMbFzICT5j/K2vXPrqfgvCyhd+eQHdZzorjCAY+yRrkAJv9QFBJU2Mh0lQyWjx80F6EuBIqeEn27ZYIHc/i0yvElHRXWldKxj8Jn7DbM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1629470969; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=bi7m7dfyxzt+rTPnbm7oQJ+rUl6Fy9BwYLkF60k1NmA=; b=YgpAm/SYjx4+SzXLugPbQPtwe5J2flKETCti4Hu00FwrZYaIsxukecy2c/uhNFinJqBBYD71RhUoVfJeFFRbcLIvedIMrk7z1JD4ps3e31CyGklEsrsFjM91NFZ3GGaOnxmxoDTJw44oTYXUuFPnHzutbdQbQUNEYxaFXX/TKmw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1629470969206695.174443930156; Fri, 20 Aug 2021 07:49:29 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-121-TOypEDOkNPq1qquD9C1Grw-1; Fri, 20 Aug 2021 10:49:26 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 2E32B80292B; Fri, 20 Aug 2021 14:49:21 +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 0819610016F7; Fri, 20 Aug 2021 14:49:21 +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 BC93C181A2A7; Fri, 20 Aug 2021 14:49:20 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 17KEn4Wt025561 for ; Fri, 20 Aug 2021 10:49:04 -0400 Received: by smtp.corp.redhat.com (Postfix) id 4AF1A6A901; Fri, 20 Aug 2021 14:49:04 +0000 (UTC) Received: from hjs.redhat.com (unknown [10.43.2.53]) by smtp.corp.redhat.com (Postfix) with ESMTP id C7FCB5D741 for ; Fri, 20 Aug 2021 14:49:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1629470968; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=bi7m7dfyxzt+rTPnbm7oQJ+rUl6Fy9BwYLkF60k1NmA=; b=AE+/E/8PAkXeVR7YZRycwN8C5V1qCdzpxUZSN41p+tIiB7kDDg21VPPeUQM8XrXq1vJ740 WRBfeAeYVE6dgiGcdRc0HajJhF26FLtbsaAWFt6AJf2Z9/Li6N/7b+lKEL8xbZ3/2ECXB1 0tKuZqyM2tlM1GdPnLvZdBKrrUiOkm0= X-MC-Unique: TOypEDOkNPq1qquD9C1Grw-1 From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Subject: [libvirt PATCH 7/9] tests: cputest: remove unnecessary labels Date: Fri, 20 Aug 2021 16:48:49 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.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.84 on 10.5.11.22 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-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1629471090602100007 Signed-off-by: J=C3=A1n Tomko --- tests/cputest.c | 72 +++++++++++++++---------------------------------- 1 file changed, 22 insertions(+), 50 deletions(-) diff --git a/tests/cputest.c b/tests/cputest.c index 2dc7e2e5ae..c8030be093 100644 --- a/tests/cputest.c +++ b/tests/cputest.c @@ -140,21 +140,17 @@ cpuTestCompareXML(virArch arch, { g_autofree char *xml =3D NULL; g_autofree char *actual =3D NULL; - int ret =3D -1; =20 xml =3D g_strdup_printf("%s/cputestdata/%s-%s.xml", abs_srcdir, virArchToString(arch), name); =20 if (!(actual =3D virCPUDefFormat(cpu, NULL))) - goto cleanup; + return -1; =20 if (virTestCompareToFile(actual, xml) < 0) - goto cleanup; + return -1; =20 - ret =3D 0; - - cleanup: - return ret; + return 0; } =20 =20 @@ -190,14 +186,13 @@ static int cpuTestCompare(const void *arg) { const struct data *data =3D arg; - int ret =3D -1; g_autoptr(virCPUDef) host =3D NULL; g_autoptr(virCPUDef) cpu =3D NULL; virCPUCompareResult result; =20 if (!(host =3D cpuTestLoadXML(data->arch, data->host)) || !(cpu =3D cpuTestLoadXML(data->arch, data->name))) - goto cleanup; + return -1; =20 result =3D virCPUCompare(host->arch, host, cpu, false); if (data->result =3D=3D VIR_CPU_COMPARE_ERROR) @@ -209,13 +204,10 @@ cpuTestCompare(const void *arg) cpuTestCompResStr(result)); /* Pad to line up with test name ... in virTestRun */ VIR_TEST_VERBOSE("%74s", "... "); - goto cleanup; + return -1; } =20 - ret =3D 0; - - cleanup: - return ret; + return 0; } =20 =20 @@ -360,7 +352,6 @@ static int cpuTestUpdate(const void *arg) { const struct data *data =3D arg; - int ret =3D -1; g_autoptr(virCPUDef) host =3D NULL; g_autoptr(virCPUDef) migHost =3D NULL; g_autoptr(virCPUDef) cpu =3D NULL; @@ -368,20 +359,17 @@ cpuTestUpdate(const void *arg) =20 if (!(host =3D cpuTestLoadXML(data->arch, data->host)) || !(cpu =3D cpuTestLoadXML(data->arch, data->name))) - goto cleanup; + return -1; =20 if (!(migHost =3D virCPUCopyMigratable(data->arch, host))) - goto cleanup; + return -1; =20 if (virCPUUpdate(host->arch, cpu, migHost) < 0) - goto cleanup; + return -1; =20 result =3D g_strdup_printf("%s+%s", data->host, data->name); =20 - ret =3D cpuTestCompareXML(data->arch, cpu, result); - - cleanup: - return ret; + return cpuTestCompareXML(data->arch, cpu, result); } =20 =20 @@ -389,17 +377,16 @@ static int cpuTestHasFeature(const void *arg) { const struct data *data =3D arg; - int ret =3D -1; g_autoptr(virCPUDef) host =3D NULL; g_autoptr(virCPUData) hostData =3D NULL; int result; =20 if (!(host =3D cpuTestLoadXML(data->arch, data->host))) - goto cleanup; + return -1; =20 if (cpuEncode(host->arch, host, NULL, &hostData, NULL, NULL, NULL, NULL) < 0) - goto cleanup; + return -1; =20 result =3D virCPUCheckFeature(host->arch, host, data->name); =20 @@ -415,13 +402,10 @@ cpuTestHasFeature(const void *arg) cpuTestBoolWithErrorStr(result)); /* Pad to line up with test name ... in virTestRun */ VIR_TEST_VERBOSE("%74s", "... "); - goto cleanup; + return -1; } =20 - ret =3D 0; - - cleanup: - return ret; + return 0; } =20 =20 @@ -629,19 +613,15 @@ cpuTestCPUIDSignature(const void *arg) g_autoptr(virCPUData) hostData =3D NULL; g_autofree char *hostFile =3D NULL; g_autofree char *host =3D NULL; - int ret =3D -1; =20 hostFile =3D g_strdup_printf("%s/cputestdata/%s-cpuid-%s.xml", abs_src= dir, virArchToString(data->arch), data->host); =20 if (virTestLoadFile(hostFile, &host) < 0 || !(hostData =3D virCPUDataParse(host))) - goto cleanup; + return -1; =20 - ret =3D cpuTestCompareSignature(data, hostData); - - cleanup: - return ret; + return cpuTestCompareSignature(data, hostData); } =20 =20 @@ -829,12 +809,11 @@ cpuTestJSONCPUID(const void *arg) g_autoptr(virQEMUCaps) qemuCaps =3D NULL; g_autoptr(virCPUDef) cpu =3D NULL; g_autofree char *result =3D NULL; - int ret =3D -1; =20 result =3D g_strdup_printf("cpuid-%s-json", data->host); =20 if (!(qemuCaps =3D cpuTestMakeQEMUCaps(data))) - goto cleanup; + return -1; =20 cpu =3D virCPUDefNew(); cpu->arch =3D data->arch; @@ -843,12 +822,9 @@ cpuTestJSONCPUID(const void *arg) cpu->fallback =3D VIR_CPU_FALLBACK_FORBID; =20 if (virQEMUCapsInitCPUModel(qemuCaps, VIR_DOMAIN_VIRT_KVM, cpu, false)= !=3D 0) - goto cleanup; + return -1; =20 - ret =3D cpuTestCompareXML(data->arch, cpu, result); - - cleanup: - return ret; + return cpuTestCompareXML(data->arch, cpu, result); } =20 =20 @@ -859,19 +835,15 @@ cpuTestJSONSignature(const void *arg) g_autoptr(virQEMUCaps) qemuCaps =3D NULL; g_autoptr(virCPUData) hostData =3D NULL; qemuMonitorCPUModelInfo *modelInfo; - int ret =3D -1; =20 if (!(qemuCaps =3D cpuTestMakeQEMUCaps(data))) - goto cleanup; + return -1; =20 modelInfo =3D virQEMUCapsGetCPUModelInfo(qemuCaps, VIR_DOMAIN_VIRT_KVM= ); if (!(hostData =3D virQEMUCapsGetCPUModelX86Data(qemuCaps, modelInfo, = false))) - goto cleanup; + return -1; =20 - ret =3D cpuTestCompareSignature(data, hostData); - - cleanup: - return ret; + return cpuTestCompareSignature(data, hostData); } #endif =20 --=20 2.31.1