From nobody Sun Feb 8 10:49:20 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 1581212010359831.0413020512894; Sat, 8 Feb 2020 17:33:30 -0800 (PST) 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-35-ovrY9l4kMfyBMqd4-Zc-Xg-1; Sat, 08 Feb 2020 20:33:27 -0500 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 17D048010F6; Sun, 9 Feb 2020 01:33:22 +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 E8FA610021B2; Sun, 9 Feb 2020 01:33: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 B3DBA18089D0; Sun, 9 Feb 2020 01:33:21 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 0191WspC021180 for ; Sat, 8 Feb 2020 20:32:54 -0500 Received: by smtp.corp.redhat.com (Postfix) id B26945C21B; Sun, 9 Feb 2020 01:32:54 +0000 (UTC) Received: from lpt.redhat.com (ovpn-200-20.brq.redhat.com [10.40.200.20]) by smtp.corp.redhat.com (Postfix) with ESMTP id E83575C28F for ; Sun, 9 Feb 2020 01:32:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1581212009; 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=D1KhVih01E+iowDxSbrgZyoSsTKoG8OYdJ9w+4wrUiM=; b=XwR8S8KizQJuurGEzAyPo0q6dMKzXxUPKYGuHWIb/uLh+QKv8mcRwK448oSklZGg1lGGOt P1qZhhrH6ZUY5kfmLCnNJV96blkdo65MWiRfFdvSRiYaHF72evvS8M8RegCI9qkFKyfgN5 lRMrjWRHLmJ2HeZCTVORGz9cMnzhnwU= From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Subject: [libvirt PATCH 4/7] testutils: remove unnecessary labels Date: Sun, 9 Feb 2020 02:32:34 +0100 Message-Id: <10f16eb595a8a65d6709ec57fad2157ebb1e4f8a.1581211907.git.jtomko@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 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 X-MC-Unique: ovrY9l4kMfyBMqd4-Zc-Xg-1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" The cleanups made some labels redundant. Signed-off-by: J=C3=A1n Tomko Reviewed-by: Daniel P. Berrang=C3=A9 --- tests/testutils.c | 44 ++++++++++++++++---------------------------- 1 file changed, 16 insertions(+), 28 deletions(-) diff --git a/tests/testutils.c b/tests/testutils.c index e9431b9b5f..a7a8a19fff 100644 --- a/tests/testutils.c +++ b/tests/testutils.c @@ -416,7 +416,6 @@ virTestCaptureProgramOutput(const char *const argv[] G_= GNUC_UNUSED, static int virTestRewrapFile(const char *filename) { - int ret =3D -1; g_autofree char *script =3D NULL; g_autoptr(virCommand) cmd =3D NULL; =20 @@ -428,11 +427,9 @@ virTestRewrapFile(const char *filename) =20 cmd =3D virCommandNewArgList(PYTHON, script, "--in-place", filename, N= ULL); if (virCommandRun(cmd, NULL) < 0) - goto cleanup; + return -1; =20 - ret =3D 0; - cleanup: - return ret; + return 0; } =20 /** @@ -663,7 +660,6 @@ int virTestCompareToFile(const char *actual, const char *filename) { - int ret =3D -1; g_autofree char *filecontent =3D NULL; g_autofree char *fixedcontent =3D NULL; const char *cmpcontent =3D actual; @@ -672,7 +668,7 @@ virTestCompareToFile(const char *actual, cmpcontent =3D ""; =20 if (virTestLoadFile(filename, &filecontent) < 0 && !virTestGetRegenera= te()) - goto failure; + return -1; =20 if (filecontent) { size_t filecontentLen =3D strlen(filecontent); @@ -690,12 +686,10 @@ virTestCompareToFile(const char *actual, virTestDifferenceFull(stderr, filecontent, filename, cmpcontent, NULL); - goto failure; + return -1; } =20 - ret =3D 0; - failure: - return ret; + return 0; } =20 int @@ -817,7 +811,6 @@ virTestGetRegenerate(void) static int virTestSetEnvPath(void) { - int ret =3D -1; const char *path =3D getenv("PATH"); g_autofree char *new_path =3D NULL; =20 @@ -830,11 +823,9 @@ virTestSetEnvPath(void) =20 if (new_path && g_setenv("PATH", new_path, TRUE) =3D=3D FALSE) - goto cleanup; + return -1; =20 - ret =3D 0; - cleanup: - return ret; + return 0; } =20 int virTestMain(int argc, @@ -1010,30 +1001,30 @@ virCapsPtr virTestGenericCapsInit(void) if ((guest =3D virCapabilitiesAddGuest(caps, VIR_DOMAIN_OSTYPE_HVM, VI= R_ARCH_I686, "/usr/bin/acme-virt", NULL, 0, NULL)) =3D=3D NULL) - goto error; + return NULL; =20 if (!virCapabilitiesAddGuestDomain(guest, VIR_DOMAIN_VIRT_TEST, NULL, = NULL, 0, NULL)) - goto error; + return NULL; if (!virCapabilitiesAddGuestDomain(guest, VIR_DOMAIN_VIRT_QEMU, NULL, NULL, 0, NULL)) - goto error; + return NULL; if (!virCapabilitiesAddGuestDomain(guest, VIR_DOMAIN_VIRT_KVM, NULL, NULL, 0, NULL)) - goto error; + return NULL; =20 if ((guest =3D virCapabilitiesAddGuest(caps, VIR_DOMAIN_OSTYPE_HVM, VI= R_ARCH_X86_64, "/usr/bin/acme-virt", NULL, 0, NULL)) =3D=3D NULL) - goto error; + return NULL; =20 if (!virCapabilitiesAddGuestDomain(guest, VIR_DOMAIN_VIRT_TEST, NULL, = NULL, 0, NULL)) - goto error; + return NULL; if (!virCapabilitiesAddGuestDomain(guest, VIR_DOMAIN_VIRT_QEMU, NULL, NULL, 0, NULL)) - goto error; + return NULL; if (!virCapabilitiesAddGuestDomain(guest, VIR_DOMAIN_VIRT_KVM, NULL, NULL, 0, NULL)) - goto error; + return NULL; =20 =20 if (virTestGetDebug() > 1) { @@ -1041,15 +1032,12 @@ virCapsPtr virTestGenericCapsInit(void) =20 caps_str =3D virCapabilitiesFormatXML(caps); if (!caps_str) - goto error; + return NULL; =20 VIR_TEST_DEBUG("Generic driver capabilities:\n%s", caps_str); } =20 return g_steal_pointer(&caps); - - error: - return NULL; } =20 =20 --=20 2.21.1