From nobody Mon Feb 9 04:46:38 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.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.129.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=1635159501; cv=none; d=zohomail.com; s=zohoarc; b=aUdlkZpw7kuApKc5kM4aVZ/KGsG0cVY6uRkF5RBsTI+nxQRoLUhfdQlT7XI9LoJxljL6TvOnZ1UtgGnSbF1Co4oi8q11R52vvnqFDhPqWmIbLevmGycYt1SKl4ilD8+YpZdKFEjJD1pdhJtYnizT1AsJwoLBxJawzUuJOdpakvw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1635159501; 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=pQadCyeE9/Ite5qe/wEqUEX20KxOTBM1pPGzLcZm+oE=; b=gozAX+GA++cJrldWGn6M30W/e3JRZaxyRqmSlsXWDTkD+Tz9D9SiKttGzooFFVfC9BRm47uIpKdkPTT6aqQFTvld7gX6Dz0lctUmXg7CXFSPVhHcRoqyV3/ZZ9t/9vQXDmT87VpzgTMOjw9rOXynk2uX2CjrjrkfPWupyvHp0VA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.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.129.124]) by mx.zohomail.com with SMTPS id 1635159501790310.75133326013224; Mon, 25 Oct 2021 03:58:21 -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-131-Ga3-xxFPPNOyPv-5qdoJkQ-1; Mon, 25 Oct 2021 06:58:17 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 2390F80A5C8; Mon, 25 Oct 2021 10:58:10 +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 0296E17CE1; Mon, 25 Oct 2021 10:58:10 +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 C19E61832DF3; Mon, 25 Oct 2021 10:58:09 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 19PAw5Lj016976 for ; Mon, 25 Oct 2021 06:58:05 -0400 Received: by smtp.corp.redhat.com (Postfix) id D187A5DAA5; Mon, 25 Oct 2021 10:58:05 +0000 (UTC) Received: from maggie.redhat.com (unknown [10.43.2.27]) by smtp.corp.redhat.com (Postfix) with ESMTP id 595665DEFB for ; Mon, 25 Oct 2021 10:58:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1635159500; 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=pQadCyeE9/Ite5qe/wEqUEX20KxOTBM1pPGzLcZm+oE=; b=AFP5lncbYyW3cF0pK44iYpQMzrVdBcztFRBiUFcSWGnPtbRbG+rUal2c7XfipPr/kQGBYD r3SVhGbnYT2PoIRXEr4uQb5Pzq3w71ZYz47LZ7QHS46nmmZruhOzd5ZRgJ7O6X3YOHksyu aZf0T3rp26cSrl7lkeezfzsPXwopnLc= X-MC-Unique: Ga3-xxFPPNOyPv-5qdoJkQ-1 From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH 13/13] qemu_monitor_json: Drop pointless error labels Date: Mon, 25 Oct 2021 12:57:37 +0200 Message-Id: <7c7013dbecd4ee4e408633853e87e719ef128607.1635159386.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 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.79 on 10.5.11.14 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-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1635159502799100001 Content-Type: text/plain; charset="utf-8" After previous cleanups, some 'error' labels were rendered needless - they contain nothing more than a return statement. Well, those labels can be dropped and 'goto error' can be replaced with return statement directly. Signed-off-by: Michal Privoznik --- src/qemu/qemu_monitor_json.c | 25 ++++++++----------------- 1 file changed, 8 insertions(+), 17 deletions(-) diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index bb76ac7d37..e9be9bdabd 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -5351,7 +5351,7 @@ qemuMonitorJSONMakeCPUModel(virCPUDef *cpu, size_t i; =20 if (virJSONValueObjectAppendString(model, "name", cpu->model) < 0) - goto error; + return NULL; =20 if (cpu->nfeatures || !migratable) { g_autoptr(virJSONValue) props =3D virJSONValueNewObject(); @@ -5367,22 +5367,19 @@ qemuMonitorJSONMakeCPUModel(virCPUDef *cpu, enabled =3D true; =20 if (virJSONValueObjectAppendBoolean(props, name, enabled) < 0) - goto error; + return NULL; } =20 if (!migratable && virJSONValueObjectAppendBoolean(props, "migratable", false) < = 0) { - goto error; + return NULL; } =20 if (virJSONValueObjectAppend(model, "props", &props) < 0) - goto error; + return NULL; } =20 return g_steal_pointer(&model); - - error: - return NULL; } =20 =20 @@ -6930,20 +6927,17 @@ qemuMonitorJSONParseCPUx86Features(virJSONValue *da= ta) size_t i; =20 if (!(cpudata =3D virCPUDataNew(VIR_ARCH_X86_64))) - goto error; + return NULL; =20 item.type =3D VIR_CPU_X86_DATA_CPUID; for (i =3D 0; i < virJSONValueArraySize(data); i++) { if (qemuMonitorJSONParseCPUx86FeatureWord(virJSONValueArrayGet(dat= a, i), &item.data.cpuid) < 0 || virCPUx86DataAdd(cpudata, &item) < 0) - goto error; + return NULL; } =20 return g_steal_pointer(&cpudata); - - error: - return NULL; } =20 =20 @@ -7049,20 +7043,17 @@ qemuMonitorJSONGetGuestCPUx86(qemuMonitor *mon, =20 if (qemuMonitorJSONGetCPUx86Data(mon, "feature-words", &cpuEnabled) < 0) - goto error; + return -1; =20 if (disabled && qemuMonitorJSONGetCPUx86Data(mon, "filtered-features", &cpuDisabled) < 0) - goto error; + return -1; =20 *data =3D g_steal_pointer(&cpuEnabled); if (disabled) *disabled =3D g_steal_pointer(&cpuDisabled); return 0; - - error: - return -1; } =20 =20 --=20 2.32.0