From nobody Sun Feb 8 17:22:21 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; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.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=1630789660; cv=none; d=zohomail.com; s=zohoarc; b=RZej4IYWT2zpJGXH++4JFYnEn2obU2BstVLpmA1HlWBoNR9esaq0xwU7aHRY/GiAAUvgEMzJxJHIh1v+vdHrEG+5oFy99CEWOz1iRP9xEs9LCaaR6wPxdzUh4j3R0B/2LwlgVWZx1mEP5tww6KUJeBtiSPD00z8wA+yNBiwghnc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1630789660; 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=z9OozX4WArNkv06lPr0OPElp7cRofmF9k4PShFJA1bY=; b=b9nQgPm7RwCXaihPwQAVo34fV/dPfG+z9xSiLLyoaIVz/yg9CuZ+dOF7M86M1ygves42ZJUKayChv8KuswPGJ16BOy23yZ9QYExk62cRwGD787ReIkWZsK26LEVEFevDJ5CAvHHu/ZeFPDCGfljktrUwA9LH2R7z8sW/d3Q+338= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.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 [170.10.133.124]) by mx.zohomail.com with SMTPS id 1630789660425853.4790004923664; Sat, 4 Sep 2021 14:07:40 -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-290-W3pZwz5VN4iprJNLWNAscg-1; Sat, 04 Sep 2021 17:07:37 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 98793100670B; Sat, 4 Sep 2021 21:07:32 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 77D641F4; Sat, 4 Sep 2021 21:07:32 +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 45B8044A66; Sat, 4 Sep 2021 21:07:32 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 184KinBD008918 for ; Sat, 4 Sep 2021 16:44:49 -0400 Received: by smtp.corp.redhat.com (Postfix) id 050352619D; Sat, 4 Sep 2021 20:44:49 +0000 (UTC) Received: from hjs.redhat.com (unknown [10.43.2.20]) by smtp.corp.redhat.com (Postfix) with ESMTP id 832581F4 for ; Sat, 4 Sep 2021 20:44:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1630789659; 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=z9OozX4WArNkv06lPr0OPElp7cRofmF9k4PShFJA1bY=; b=WM7wFldScZyxi8+elZ+PXrD67Dbc7IwA7IsXBTHF7dpA9jYZxkEoxGZ75VmJ87t5xqICil 9aP3Kr++Zu39yb10AA/87S64VkI4NrIJA1GKh+Xc4LR6DS+dNZhDsKqXBZYGPWOJ5mXQ2T aV5APQogYPVvP0w3w5n7l9lBdKnntZw= X-MC-Unique: W3pZwz5VN4iprJNLWNAscg-1 From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Subject: [libvirt PATCH 20/24] tests: libxl: remove pointless labels Date: Sat, 4 Sep 2021 22:44:18 +0200 Message-Id: <989d92cb9082dc31b35b9ec2f34235016869a726.1630788206.git.jtomko@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 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.23 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: 1630789662473100001 Signed-off-by: J=C3=A1n Tomko --- tests/xlconfigtest.c | 48 ++++++++++++++++++-------------------------- tests/xmconfigtest.c | 37 +++++++++++++--------------------- 2 files changed, 34 insertions(+), 51 deletions(-) diff --git a/tests/xlconfigtest.c b/tests/xlconfigtest.c index 6717377982..d6505f9e12 100644 --- a/tests/xlconfigtest.c +++ b/tests/xlconfigtest.c @@ -68,47 +68,43 @@ testCompareParseXML(const char *xlcfg, const char *xml,= bool replaceVars) g_autoptr(virConf) conf =3D NULL; g_autoptr(virConnect) conn =3D NULL; int wrote =3D 4096; - int ret =3D -1; g_autoptr(virDomainDef) def =3D NULL; g_autofree char *replacedXML =3D NULL; =20 gotxlcfgData =3D g_new0(char, wrote); =20 conn =3D virGetConnect(); - if (!conn) goto fail; + if (!conn) + return -1; =20 if (replaceVars) { if (!(replacedXML =3D testReplaceVarsXML(xml))) - goto fail; + return -1; if (!(def =3D virDomainDefParseString(replacedXML, driver->xmlopt, NULL, VIR_DOMAIN_XML_INACTIVE)= )) - goto fail; + return -1; } else { if (!(def =3D virDomainDefParseFile(xml, driver->xmlopt, NULL, VIR_DOMAIN_XML_INACTIVE))) - goto fail; + return -1; } =20 if (!virDomainDefCheckABIStability(def, def, driver->xmlopt)) { fprintf(stderr, "ABI stability check failed on %s", xml); - goto fail; + return -1; } =20 if (!(conf =3D xenFormatXL(def, conn))) - goto fail; + return -1; =20 if (virConfWriteMem(gotxlcfgData, &wrote, conf) < 0) - goto fail; + return -1; gotxlcfgData[wrote] =3D '\0'; =20 if (virTestCompareToFile(gotxlcfgData, xlcfg) < 0) - goto fail; + return -1; =20 - ret =3D 0; - - fail: - - return ret; + return 0; } =20 /* @@ -121,44 +117,40 @@ testCompareFormatXML(const char *xlcfg, const char *x= ml, bool replaceVars) g_autofree char *xlcfgData =3D NULL; g_autofree char *gotxml =3D NULL; g_autoptr(virConf) conf =3D NULL; - int ret =3D -1; g_autoptr(virConnect) conn =3D NULL; g_autoptr(virDomainDef) def =3D NULL; g_autofree char *replacedXML =3D NULL; g_autoptr(libxlDriverConfig) cfg =3D libxlDriverConfigGet(driver); =20 conn =3D virGetConnect(); - if (!conn) goto fail; + if (!conn) + return -1; =20 if (virTestLoadFile(xlcfg, &xlcfgData) < 0) - goto fail; + return -1; =20 if (!(conf =3D virConfReadString(xlcfgData, 0))) - goto fail; + return -1; =20 if (!(def =3D xenParseXL(conf, cfg->caps, driver->xmlopt))) - goto fail; + return -1; =20 if (!(gotxml =3D virDomainDefFormat(def, driver->xmlopt, VIR_DOMAIN_XML_INACTIVE | VIR_DOMAIN_XML_SECURE))) - goto fail; + return -1; =20 if (replaceVars) { if (!(replacedXML =3D testReplaceVarsXML(xml))) - goto fail; + return -1; if (virTestCompareToString(gotxml, replacedXML) < 0) - goto fail; + return -1; } else { if (virTestCompareToFile(gotxml, xml) < 0) - goto fail; + return -1; } =20 - ret =3D 0; - - fail: - - return ret; + return 0; } =20 =20 diff --git a/tests/xmconfigtest.c b/tests/xmconfigtest.c index bd23e5fd5d..c99d1f2bd9 100644 --- a/tests/xmconfigtest.c +++ b/tests/xmconfigtest.c @@ -41,7 +41,6 @@ testCompareParseXML(const char *xmcfg, const char *xml) { g_autofree char *gotxmcfgData =3D NULL; g_autoptr(virConf) conf =3D NULL; - int ret =3D -1; g_autoptr(virConnect) conn =3D NULL; int wrote =3D 4096; g_autoptr(virDomainDef) def =3D NULL; @@ -49,32 +48,29 @@ testCompareParseXML(const char *xmcfg, const char *xml) gotxmcfgData =3D g_new0(char, wrote); =20 conn =3D virGetConnect(); - if (!conn) goto fail; + if (!conn) + return -1; =20 if (!(def =3D virDomainDefParseFile(xml, driver->xmlopt, NULL, VIR_DOMAIN_DEF_PARSE_INACTIVE))) - goto fail; + return -1; =20 if (!virDomainDefCheckABIStability(def, def, driver->xmlopt)) { fprintf(stderr, "ABI stability check failed on %s", xml); - goto fail; + return -1; } =20 if (!(conf =3D xenFormatXM(conn, def))) - goto fail; + return -1; =20 if (virConfWriteMem(gotxmcfgData, &wrote, conf) < 0) - goto fail; + return -1; gotxmcfgData[wrote] =3D '\0'; =20 if (virTestCompareToFile(gotxmcfgData, xmcfg) < 0) - goto fail; + return -1; =20 - ret =3D 0; - - fail: - - return ret; + return 0; } =20 static int @@ -83,30 +79,25 @@ testCompareFormatXML(const char *xmcfg, const char *xml) g_autofree char *xmcfgData =3D NULL; g_autofree char *gotxml =3D NULL; g_autoptr(virConf) conf =3D NULL; - int ret =3D -1; g_autoptr(virDomainDef) def =3D NULL; g_autoptr(libxlDriverConfig) cfg =3D libxlDriverConfigGet(driver); =20 if (virTestLoadFile(xmcfg, &xmcfgData) < 0) - goto fail; + return -1; =20 if (!(conf =3D virConfReadString(xmcfgData, 0))) - goto fail; + return -1; =20 if (!(def =3D xenParseXM(conf, cfg->caps, driver->xmlopt))) - goto fail; + return -1; =20 if (!(gotxml =3D virDomainDefFormat(def, driver->xmlopt, VIR_DOMAIN_DE= F_FORMAT_SECURE))) - goto fail; + return -1; =20 if (virTestCompareToFile(gotxml, xml) < 0) - goto fail; + return -1; =20 - ret =3D 0; - - fail: - - return ret; + return 0; } =20 =20 --=20 2.31.1