From nobody Tue Feb 10 13:16:41 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) client-ip=207.211.31.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 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=1594006992; cv=none; d=zohomail.com; s=zohoarc; b=JnwfJqbYR72ybIgD115OfejGJPTDaury5b8fNKItnuMyRLYDcmdocc3lCGC187W8Vm/vaO4HVy9A9oqL1yt9/AFQGyQTj2sYCwe2Ku3jgwlzOsVMBkivJ6X6fP04SZKswjJGiOkU0fvGbhgYbPEz5YwNkxgce7jj954nQsdCNAk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1594006992; 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=WBKFtNefpzpaXrnFpcdsO1pPtmOTvxoWOQAKh4R3LFE=; b=YrPT/Talyaz/NGNtktTsvK0uaMqBnpoQaGe/inzDuYEZs4Wen0tfD1MqNfdEq/wQm/3LQ8rXGe/6Qeb/AIsFk0IqvICGnQEXws1wMl9MN+vyVnLZdDecMHqNdfk4NBNCckadkcYBgyEqW60pL2JaN9oQsoO8Zbbdw+0e8KOW428= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 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-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by mx.zohomail.com with SMTPS id 1594006992969330.37742017520395; Sun, 5 Jul 2020 20:43:12 -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-28-1WgA7JSONHGSQVZ70gmJRw-1; Sun, 05 Jul 2020 23:42:34 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B8BD3805EFD; Mon, 6 Jul 2020 03:42:28 +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 9C50B5C1D4; Mon, 6 Jul 2020 03:42:28 +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 6D2BB93F91; Mon, 6 Jul 2020 03:42:28 +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 0663g3cV004670 for ; Sun, 5 Jul 2020 23:42:03 -0400 Received: by smtp.corp.redhat.com (Postfix) id BA8D7275E39; Mon, 6 Jul 2020 03:42:03 +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 6E9B9275E36 for ; Mon, 6 Jul 2020 03:41:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1594006991; 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=WBKFtNefpzpaXrnFpcdsO1pPtmOTvxoWOQAKh4R3LFE=; b=Oghb1vqA8AKodWffzVLT8etcRWf0vzeVlgd/zsUDEQ1X15G5lySrj2HuE36LkR51pL3ANb wxrIj2NcoJ0arzWmMkrtH5wOy6KwTy0oA+/sUPvWLGNKQd3WwF/S0m5nL0+oEI6mv+LJ4y UNhJdJrGcvvshaxfMpx7sNPPqW/jJEM= X-MC-Unique: 1WgA7JSONHGSQVZ70gmJRw-1 From: Laine Stump To: libvir-list@redhat.com Subject: [PATCH 20/32] bhyve: eliminate unnecessary labels Date: Sun, 5 Jul 2020 23:41:15 -0400 Message-Id: <20200706034127.1117504-21-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.16 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/bhyve/bhyve_command.c | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/src/bhyve/bhyve_command.c b/src/bhyve/bhyve_command.c index 9649c2d2a2..22d0b24ec4 100644 --- a/src/bhyve/bhyve_command.c +++ b/src/bhyve/bhyve_command.c @@ -169,7 +169,6 @@ bhyveBuildAHCIControllerArgStr(const virDomainDef *def, g_auto(virBuffer) buf =3D VIR_BUFFER_INITIALIZER; const char *disk_source; size_t i; - int ret =3D -1; =20 for (i =3D 0; i < def->ndisks; i++) { g_auto(virBuffer) device =3D VIR_BUFFER_INITIALIZER; @@ -187,11 +186,11 @@ bhyveBuildAHCIControllerArgStr(const virDomainDef *de= f, (virDomainDiskGetType(disk) !=3D VIR_STORAGE_TYPE_VOLUME)) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("unsupported disk type")); - goto error; + return -1; } =20 if (virDomainDiskTranslateSourcePool(disk) < 0) - goto error; + return -1; =20 disk_source =3D virDomainDiskGetSource(disk); =20 @@ -200,7 +199,7 @@ bhyveBuildAHCIControllerArgStr(const virDomainDef *def, virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("cdrom device without source path " "not supported")); - goto error; + return -1; } =20 switch (disk->device) { @@ -219,7 +218,7 @@ bhyveBuildAHCIControllerArgStr(const virDomainDef *def, default: virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("unsupported disk device")); - goto error; + return -1; } virBufferAddBuffer(&buf, &device); } @@ -229,9 +228,7 @@ bhyveBuildAHCIControllerArgStr(const virDomainDef *def, controller->info.addr.pci.slot, virBufferCurrentContent(&buf)); =20 - ret =3D 0; - error: - return ret; + return 0; } =20 static int @@ -406,7 +403,7 @@ bhyveBuildGraphicsArgStr(const virDomainDef *def, if (!(glisten =3D virDomainGraphicsGetListen(graphics, 0))) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("Missing listen element")); - goto error; + return -1; } =20 virBufferAsprintf(&opt, "%d:%d,fbuf", video->info.addr.pci.slot, video= ->info.addr.pci.function); @@ -421,13 +418,13 @@ bhyveBuildGraphicsArgStr(const virDomainDef *def, graphics->data.vnc.port > 65535)) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("vnc port must be in range [5900,65535]")); - goto error; + return -1; } =20 if (graphics->data.vnc.auth.passwd) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("vnc password auth not supported")); - goto error; + return -1; } else { /* Bhyve doesn't support VNC Auth yet, so print a warning abo= ut * unauthenticated VNC sessions */ @@ -461,11 +458,11 @@ bhyveBuildGraphicsArgStr(const virDomainDef *def, case VIR_DOMAIN_GRAPHICS_LISTEN_TYPE_NONE: virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("Unsupported listen type")); - goto error; + return -1; case VIR_DOMAIN_GRAPHICS_LISTEN_TYPE_LAST: default: virReportEnumRangeError(virDomainGraphicsListenType, glisten->type= ); - goto error; + return -1; } =20 if (video->driver) @@ -476,8 +473,6 @@ bhyveBuildGraphicsArgStr(const virDomainDef *def, virCommandAddArgBuffer(cmd, &opt); return 0; =20 - error: - return -1; } =20 virCommandPtr --=20 2.25.4