From nobody Sun Feb 8 09:11:19 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=1646229420; cv=none; d=zohomail.com; s=zohoarc; b=Ot924vDEYr/qwlX1E1J0Kauw7ZjzkWTh5Bmpl9QHjWSqCjDh0AIy7XO3OMXDV84t8NUk7+DPXdAjFneZtGM3zGOzsfi7DNnMKt0TkIRf+zX6QcjJt5DUmTtodrhB7L//f1espfdFjLUIp9ni9IwEPiOZKWL3CKHMe3UxoxpiPko= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1646229420; 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=XMykoCqsIj+3F79+UO2dMZ7dsUaDmmkqlUso5pYGR0s=; b=Q9yzbFzbi2Zhw+PLiCEbi+Yiyx7F6r/UU0nbdwqvcQd9lyK6laPl3a9zhZGtEd1OnADuGRAAYR+7JeOky43i5df6NElC7YLlcmfn+vnGkYanMxjaxIKhY0VnaKm/F4LZn6zCG/gUJ9Q7wxAPvffUNQ6qn2j7U3pS2qMjrrs1jeY= 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 1646229420648161.6563487217869; Wed, 2 Mar 2022 05:57:00 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-298-JVlXi8etPNOu9eyky5sbRg-1; Wed, 02 Mar 2022 08:56:55 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 361C110199BF; Wed, 2 Mar 2022 13:56:49 +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 12A977D879; Wed, 2 Mar 2022 13:56:49 +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 D9AEA4ED79; Wed, 2 Mar 2022 13:56:48 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 222DuhU6018268 for ; Wed, 2 Mar 2022 08:56:43 -0500 Received: by smtp.corp.redhat.com (Postfix) id 6441783788; Wed, 2 Mar 2022 13:56:43 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.30]) by smtp.corp.redhat.com (Postfix) with ESMTP id BAF2483783 for ; Wed, 2 Mar 2022 13:56:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1646229419; 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=XMykoCqsIj+3F79+UO2dMZ7dsUaDmmkqlUso5pYGR0s=; b=IhEIRXL48/0uReym/ttEsY3B5rV1aNL3x9f50w91cpJlUc3X2R4HPfGvQwaHKkpR6gvO0B 0vaHZVUfDZIrWcXHpJhcpEPxfbeMVYizuSX6irVfMrPmkNxwROGBcYpVhXim7laichoWb4 zG5gU9MrcASluQ4abesSxD73BGKx1pg= X-MC-Unique: JVlXi8etPNOu9eyky5sbRg-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 21/23] virsh: cmdDesc: Remove unneeded 'cleanup' Date: Wed, 2 Mar 2022 14:55:20 +0100 Message-Id: <7ee425ed968bfa35e86e00a7191d6e2d391d6022.1646229194.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 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.13 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: 1646229421565100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Peter Krempa --- tools/virsh-domain.c | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c index 4d9722f400..7b4f8638a9 100644 --- a/tools/virsh-domain.c +++ b/tools/virsh-domain.c @@ -8336,7 +8336,6 @@ cmdDesc(vshControl *ctl, const vshCmd *cmd) g_autofree char *desc =3D NULL; const vshCmdOpt *opt =3D NULL; g_auto(virBuffer) buf =3D VIR_BUFFER_INITIALIZER; - bool ret =3D false; unsigned int flags =3D VIR_DOMAIN_AFFECT_CURRENT; unsigned int queryflags =3D 0; @@ -8354,7 +8353,7 @@ cmdDesc(vshControl *ctl, const vshCmd *cmd) return false; if ((state =3D virshDomainState(ctl, dom, NULL)) < 0) - goto cleanup; + return false; if (title) type =3D VIR_DOMAIN_METADATA_TITLE; @@ -8372,7 +8371,7 @@ cmdDesc(vshControl *ctl, const vshCmd *cmd) if (!desc) { desc =3D virshGetDomainDescription(ctl, dom, title, queryf= lags); if (!desc) - goto cleanup; + return false; } if (edit) { @@ -8382,15 +8381,15 @@ cmdDesc(vshControl *ctl, const vshCmd *cmd) /* Create and open the temporary file. */ if (!(tmp =3D vshEditWriteToTempFile(ctl, desc))) - goto cleanup; + return false; /* Start the editor. */ if (vshEditFile(ctl, tmp) =3D=3D -1) - goto cleanup; + return false; /* Read back the edited file. */ if (!(desc_edited =3D vshEditReadBackFile(ctl, tmp))) - goto cleanup; + return false; /* strip a possible newline at the end of file; some * editors enforce a newline, this makes editing the title @@ -8405,8 +8404,7 @@ cmdDesc(vshControl *ctl, const vshCmd *cmd) vshPrintExtra(ctl, "%s", title ? _("Domain title not changed\n") : _("Domain description not changed\n"= )); - ret =3D true; - goto cleanup; + return true; } VIR_FREE(desc); @@ -8417,7 +8415,7 @@ cmdDesc(vshControl *ctl, const vshCmd *cmd) vshError(ctl, "%s", title ? _("Failed to set new domain title") : _("Failed to set new domain description")); - goto cleanup; + return false; } vshPrintExtra(ctl, "%s", title ? _("Domain title updated successfully") : @@ -8425,7 +8423,7 @@ cmdDesc(vshControl *ctl, const vshCmd *cmd) } else { desc =3D virshGetDomainDescription(ctl, dom, title, queryflags); if (!desc) - goto cleanup; + return false; if (strlen(desc) > 0) vshPrint(ctl, "%s", desc); @@ -8436,9 +8434,7 @@ cmdDesc(vshControl *ctl, const vshCmd *cmd) virDomainGetName(dom)); } - ret =3D true; - cleanup: - return ret; + return true; } --=20 2.35.1