From nobody Tue Feb 10 07:41:38 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 ARC-Seal: i=1; a=rsa-sha256; t=1594006946; cv=none; d=zohomail.com; s=zohoarc; b=AXkkznau0swc+mITpnPGwgEyN07iw79lF6DOrMz/85SPLADYgUAXXF9b1sD3JaQ2p4AV3geJPTdvwmXMw9+CnFj3nTVfckPsqLNitKtIZExxTPCCc3jsCUp6wpsexH/qfmlw1yufBbqsQulbZIL3Oe3fJC/TVyl+35AnswhL6PU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1594006946; 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=zakrDooXfkU1Mo85Jr9Q8aZZSyonYd4r1Xv9U2dA1JQ=; b=g+iDv/3dx2+1D9fqMTDIUtjZFuS6xPGWVzyqIBPybkpo/41xPhuqgpJRyi2XZIS+J6un83Ud0DGWJUNIgLDF58WyCud8JaC7JMFFFaj+/Ez6aYrZq3p2Q1WUGB4TzW56if2lvuaqm1DWi6taYONxzSWpnJ+Jy7rnIun4dKX9j2c= ARC-Authentication-Results: i=1; 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 header.from= (p=none dis=none) header.from= 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 1594006946604998.0998584125244; Sun, 5 Jul 2020 20:42:26 -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-181-jGUbIkrtPS-vEJvtx1u-Mw-1; Sun, 05 Jul 2020 23:42:23 -0400 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 25A9F18FE86A; Mon, 6 Jul 2020 03:42:17 +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 09D2A6E6E4; Mon, 6 Jul 2020 03:42:17 +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 D260293F70; Mon, 6 Jul 2020 03:42:16 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 0663gAwJ004719 for ; Sun, 5 Jul 2020 23:42:10 -0400 Received: by smtp.corp.redhat.com (Postfix) id 8EF26275E39; Mon, 6 Jul 2020 03:42:10 +0000 (UTC) Received: from vhost2.laine.org (ovpn-112-194.phx2.redhat.com [10.3.112.194]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4346C275E36 for ; Mon, 6 Jul 2020 03:42:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1594006945; 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=zakrDooXfkU1Mo85Jr9Q8aZZSyonYd4r1Xv9U2dA1JQ=; b=NTch6HQ4FjdNAipDfr2i9Kar04t7Bxs/I8Zus3rEZjzBh4sY5VRE84t+ZhArW2bJLqqpb1 3wqXvCINHYv9B0RAkRJFTGywqSfdEnenbJ63NbkxoiuGU7tYzr+ipIIVRpMl6ZiGrLmMVI jmFO8rssZNxQVJvIqne/ox1S4N7Qgos= X-MC-Unique: jGUbIkrtPS-vEJvtx1u-Mw-1 From: Laine Stump To: libvir-list@redhat.com Subject: [PATCH 22/32] libxl: eliminate unnecessary labels Date: Sun, 5 Jul 2020 23:41:17 -0400 Message-Id: <20200706034127.1117504-23-laine@redhat.com> In-Reply-To: <20200706034127.1117504-1-laine@redhat.com> References: <20200706034127.1117504-1-laine@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 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.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-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Signed-off-by: Laine Stump Reviewed-by: J=C3=A1n Tomko --- src/libxl/libxl_conf.c | 11 ++++------- src/libxl/xen_common.c | 16 +++++----------- src/libxl/xen_xl.c | 25 ++++++++----------------- src/libxl/xen_xm.c | 7 ++----- 4 files changed, 19 insertions(+), 40 deletions(-) diff --git a/src/libxl/libxl_conf.c b/src/libxl/libxl_conf.c index fe8ad4a3cb..02cc5e6f1b 100644 --- a/src/libxl/libxl_conf.c +++ b/src/libxl/libxl_conf.c @@ -910,7 +910,6 @@ libxlMakeNetworkDiskSrcStr(virStorageSourcePtr src, const char *username, const char *secret) { - char *ret =3D NULL; g_auto(virBuffer) buf =3D VIR_BUFFER_INITIALIZER; size_t i; =20 @@ -931,14 +930,14 @@ libxlMakeNetworkDiskSrcStr(virStorageSourcePtr src, virReportError(VIR_ERR_NO_SUPPORT, _("Unsupported network block protocol '%s'"), virStorageNetProtocolTypeToString(src->protocol)); - goto cleanup; + return NULL; =20 case VIR_STORAGE_NET_PROTOCOL_RBD: if (strchr(src->path, ':')) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("':' not allowed in RBD source volume name '%= s'"), src->path); - goto cleanup; + return NULL; } =20 virBufferStrcat(&buf, "rbd:", src->volume, "/", src->path, NULL); @@ -973,12 +972,10 @@ libxlMakeNetworkDiskSrcStr(virStorageSourcePtr src, if (src->configFile) virBufferEscape(&buf, '\\', ":", ":conf=3D%s", src->configFile= ); =20 - ret =3D virBufferContentAndReset(&buf); - break; + return virBufferContentAndReset(&buf); } =20 - cleanup: - return ret; + return NULL; } =20 static int diff --git a/src/libxl/xen_common.c b/src/libxl/xen_common.c index 6b16752c8a..475c64f944 100644 --- a/src/libxl/xen_common.c +++ b/src/libxl/xen_common.c @@ -1640,13 +1640,13 @@ xenFormatSerial(virConfValuePtr list, virDomainChrD= efPtr serial) if (serial) { ret =3D xenFormatSxprChr(serial, &buf); if (ret < 0) - goto cleanup; + return -1; } else { virBufferAddLit(&buf, "none"); } =20 if (VIR_ALLOC(val) < 0) - goto cleanup; + return -1; =20 val->type =3D VIR_CONF_STRING; val->str =3D virBufferContentAndReset(&buf); @@ -1659,9 +1659,6 @@ xenFormatSerial(virConfValuePtr list, virDomainChrDef= Ptr serial) list->list =3D val; =20 return 0; - - cleanup: - return -1; } =20 char * @@ -1781,12 +1778,12 @@ xenFormatNet(virConnectPtr conn, case VIR_DOMAIN_NET_TYPE_USER: virReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("Unsupported net type= '%s'"), virDomainNetTypeToString(net->type)); - goto cleanup; + return -1; =20 case VIR_DOMAIN_NET_TYPE_LAST: default: virReportEnumRangeError(virDomainNetType, net->type); - goto cleanup; + return -1; } =20 if (virDomainNetGetModelString(net)) { @@ -1810,7 +1807,7 @@ xenFormatNet(virConnectPtr conn, virBufferAsprintf(&buf, ",rate=3D%lluKB/s", net->bandwidth->out->a= verage); =20 if (VIR_ALLOC(val) < 0) - goto cleanup; + return -1; =20 val->type =3D VIR_CONF_STRING; val->str =3D virBufferContentAndReset(&buf); @@ -1823,9 +1820,6 @@ xenFormatNet(virConnectPtr conn, list->list =3D val; =20 return 0; - - cleanup: - return -1; } =20 =20 diff --git a/src/libxl/xen_xl.c b/src/libxl/xen_xl.c index 4baf5e336e..b81c5d23ce 100644 --- a/src/libxl/xen_xl.c +++ b/src/libxl/xen_xl.c @@ -1412,11 +1412,10 @@ static int xenFormatXLVnode(virConfValuePtr list, virBufferPtr buf) { - int ret =3D -1; virConfValuePtr numaPnode, tmp; =20 if (VIR_ALLOC(numaPnode) < 0) - goto cleanup; + return -1; =20 /* Place VNODE directive */ numaPnode->type =3D VIR_CONF_STRING; @@ -1429,10 +1428,8 @@ xenFormatXLVnode(virConfValuePtr list, tmp->next =3D numaPnode; else list->list =3D numaPnode; - ret =3D 0; =20 - cleanup: - return ret; + return 0; } =20 static int @@ -1561,7 +1558,6 @@ xenFormatXLXenbusLimits(virConfPtr conf, virDomainDef= Ptr def) static char * xenFormatXLDiskSrcNet(virStorageSourcePtr src) { - char *ret =3D NULL; g_auto(virBuffer) buf =3D VIR_BUFFER_INITIALIZER; size_t i; =20 @@ -1582,14 +1578,14 @@ xenFormatXLDiskSrcNet(virStorageSourcePtr src) virReportError(VIR_ERR_NO_SUPPORT, _("Unsupported network block protocol '%s'"), virStorageNetProtocolTypeToString(src->protocol)); - goto cleanup; + return NULL; =20 case VIR_STORAGE_NET_PROTOCOL_RBD: if (strchr(src->path, ':')) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("':' not allowed in RBD source volume name '%= s'"), src->path); - goto cleanup; + return NULL; } =20 virBufferStrcat(&buf, "rbd:", src->volume, "/", src->path, NULL); @@ -1614,12 +1610,10 @@ xenFormatXLDiskSrcNet(virStorageSourcePtr src) } } =20 - ret =3D virBufferContentAndReset(&buf); - break; + return virBufferContentAndReset(&buf); } =20 - cleanup: - return ret; + return NULL; } =20 =20 @@ -2111,14 +2105,14 @@ xenFormatXLChannel(virConfValuePtr list, virDomainC= hrDefPtr channel) channel->source->data.nix.path); break; default: - goto cleanup; + return -1; } =20 /* name */ virBufferAsprintf(&buf, "name=3D%s", channel->target.name); =20 if (VIR_ALLOC(val) < 0) - goto cleanup; + return -1; =20 val->type =3D VIR_CONF_STRING; val->str =3D virBufferContentAndReset(&buf); @@ -2130,9 +2124,6 @@ xenFormatXLChannel(virConfValuePtr list, virDomainChr= DefPtr channel) else list->list =3D val; return 0; - - cleanup: - return -1; } =20 static int diff --git a/src/libxl/xen_xm.c b/src/libxl/xen_xm.c index f28326ade8..81b64a2fb4 100644 --- a/src/libxl/xen_xm.c +++ b/src/libxl/xen_xm.c @@ -322,7 +322,7 @@ xenFormatXMDisk(virConfValuePtr list, virReportError(VIR_ERR_INTERNAL_ERROR, _("unsupported disk type %s"), virStorageTypeToString(virDomainDiskGetType= (disk))); - goto cleanup; + return -1; } } virBufferAdd(&buf, src, -1); @@ -346,7 +346,7 @@ xenFormatXMDisk(virConfValuePtr list, } =20 if (VIR_ALLOC(val) < 0) - goto cleanup; + return -1; =20 val->type =3D VIR_CONF_STRING; val->str =3D virBufferContentAndReset(&buf); @@ -359,9 +359,6 @@ xenFormatXMDisk(virConfValuePtr list, list->list =3D val; =20 return 0; - - cleanup: - return -1; } =20 =20 --=20 2.25.4