From nobody Mon Feb 9 14:00:28 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) client-ip=63.128.21.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 63.128.21.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=1603359328; cv=none; d=zohomail.com; s=zohoarc; b=ke/xW2+dsfgfqZwGo1a4BHyRAhPcfMKz40hlVw3G16vt2kNNTTATukjB0qIzrV2r2/qfQIxp4kUl5+IsoNCzDiZXvBq1YTSpHRkWNK2AKNuK7c4FszafQgZ7pCqbarSIjHxNr3/WKdXUj0H9wYCFYG2raGEURldmUZCUNaMw9mo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1603359328; 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=aoOZN3GR1Aiv1pARW5BowhDcasGqcwtyBBf8FvupENo=; b=FHtEnZrETvVDG5EU53dXYPrCGReFAQEyRFVQgAkcf3PxqTfi+/5UfNR6RL51+6Mfmj4ib3+1iR3+0ai+AzSyFfoS348p7SrfMg4dEBC6V6LIX/Op36o3Q824JiRUTRkWe59Gv6f+29Jj5CChVkhwLXM52nQIb/n0G5tIWSITLiQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 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-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mx.zohomail.com with SMTPS id 1603359328752724.5595063659964; Thu, 22 Oct 2020 02:35:28 -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-488-MFdPXwA4MpO0TuUd7yh_Vw-1; Thu, 22 Oct 2020 05:35:24 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 21F005F9CC; Thu, 22 Oct 2020 09:35:19 +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 D8DF219C4F; Thu, 22 Oct 2020 09:35:18 +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 980F0180B791; Thu, 22 Oct 2020 09:35:18 +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 09M9ZGJo024469 for ; Thu, 22 Oct 2020 05:35:16 -0400 Received: by smtp.corp.redhat.com (Postfix) id F2FB65B4A8; Thu, 22 Oct 2020 09:35:15 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.55]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5D4515B4A3 for ; Thu, 22 Oct 2020 09:35:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1603359326; 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=aoOZN3GR1Aiv1pARW5BowhDcasGqcwtyBBf8FvupENo=; b=KDfLsI/5Tq9pdgcnA6gw20poX1NChwQgHGHaNQtUj+fYGPxPNe7LelZ0LBPU7Q6CylGMv2 BibPwH9tfcHF0G/kQOrslkZ/JGOxvjyyHRjFM7UpvV36JTAaBQKDYYbe6NlzbX3b4SwBdx PWaP1BxuUCftRNSSYr05NINmyDlsveY= X-MC-Unique: MFdPXwA4MpO0TuUd7yh_Vw-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 04/15] virCgroupKillRecursive: Refactor cleanup Date: Thu, 22 Oct 2020 11:34:55 +0200 Message-Id: In-Reply-To: References: 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.84 on 10.5.11.23 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" Remove 'cleanup' label and simplify remembering of the returned value from the callback. Signed-off-by: Peter Krempa --- src/util/vircgroup.c | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/src/util/vircgroup.c b/src/util/vircgroup.c index b74ec1a8fa..dafc6c98c0 100644 --- a/src/util/vircgroup.c +++ b/src/util/vircgroup.c @@ -2532,8 +2532,7 @@ virCgroupKillRecursiveInternal(virCgroupPtr group, int virCgroupKillRecursive(virCgroupPtr group, int signum) { - int ret =3D 0; - int rc; + int ret =3D -1; size_t i; bool backendAvailable =3D false; virCgroupBackendPtr *backends =3D virCgroupBackendGetAll(); @@ -2544,24 +2543,17 @@ virCgroupKillRecursive(virCgroupPtr group, int sign= um) for (i =3D 0; i < VIR_CGROUP_BACKEND_TYPE_LAST; i++) { if (backends && backends[i] && backends[i]->available()) { backendAvailable =3D true; - rc =3D backends[i]->killRecursive(group, signum, pids); - if (rc < 0) { - ret =3D -1; - goto cleanup; - } - if (rc > 0) - ret =3D rc; + if ((ret =3D backends[i]->killRecursive(group, signum, pids)) = < 0) + return -1; } } if (!backends || !backendAvailable) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("no cgroup backend available")); - ret =3D -1; - goto cleanup; + return -1; } - cleanup: return ret; } --=20 2.26.2