From nobody Tue Feb 10 01:30:23 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) client-ip=205.139.110.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 205.139.110.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=1586208530; cv=none; d=zohomail.com; s=zohoarc; b=dvPRxoIbbDcc12mv1aG+pSXpp5lzz0HnqNfOGHRAzPt1uj2XMRDW47W0XO1YTA7ktuRi8IHu+RoHkD8FbmLJGuJ6dTNiDlu0+j+33HTT+JvP9mFHgCWYyQ79tGCzV8B8yDyeoaljqVNkEdLl8PIqBdQmz0NheVz0yUX9f6svY+4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1586208530; h=Content-Type:Content-Transfer-Encoding:Cc: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=KErxApbrDRThEGa/6BO9Te5Z2HwNzuEEBAppKXNYgog=; b=ZZSywEuyMeP69TCLnI2mVDrRx7RX9SXfAVgnIqgadu3BHPfZy28v1QZlEWmuS/DklQp8OvnS1XucHTnKQPyQ6K+0ExLPkrmQB8ye3vDRaDrQC4GJe9SZqc7ZPUuGkCE1bNq5ClPeUDTKaboT07AUjEuPAPcRjDS0iYun8F9D/o4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.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 [205.139.110.120]) by mx.zohomail.com with SMTPS id 1586208530855190.73144138504938; Mon, 6 Apr 2020 14:28:50 -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-210-a4i-BS2TNk-MNdL1GpX9bQ-1; Mon, 06 Apr 2020 17:28:46 -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 65CBC85EE6C; Mon, 6 Apr 2020 21:28:41 +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 348B35C541; Mon, 6 Apr 2020 21:28:41 +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 E21E718089D0; Mon, 6 Apr 2020 21:28:40 +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 036LSdD1015867 for ; Mon, 6 Apr 2020 17:28:39 -0400 Received: by smtp.corp.redhat.com (Postfix) id A02D65DA7C; Mon, 6 Apr 2020 21:28:39 +0000 (UTC) Received: from localhost (unknown [10.36.110.72]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9DBC65DA60; Mon, 6 Apr 2020 21:28:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1586208529; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc: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=KErxApbrDRThEGa/6BO9Te5Z2HwNzuEEBAppKXNYgog=; b=LmNOOZpsKmUldCn5OQTtktS1iV+XpBsX030COSwtHb6/YJPDpG74zHdR0olc43Hy7IHDJY jWz0USC359D/oQSvg0szu4wEjF4XQIwMdlqNvDD56yqJdnvzGiePBVf1tkG7ng3KkfN0SW rEcVz1LRsqeXmJyYCTmMKMIaNYm1mZo= X-MC-Unique: a4i-BS2TNk-MNdL1GpX9bQ-1 From: marcandre.lureau@redhat.com To: libvir-list@redhat.com Subject: [libvirt PATCH 12/15] cgroup: return directly if there is nothing to remove Date: Mon, 6 Apr 2020 23:27:09 +0200 Message-Id: <20200406212712.1315604-13-marcandre.lureau@redhat.com> In-Reply-To: <20200406212712.1315604-1-marcandre.lureau@redhat.com> References: <20200406212712.1315604-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Cc: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , phrdina@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 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" From: Marc-Andr=C3=A9 Lureau This fixes an error path when virCgroupV2DevicesDetectProg() fails but wasn't needed in the first place on VM shutdown. Signed-off-by: Marc-Andr=C3=A9 Lureau --- src/util/vircgroupv2devices.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/util/vircgroupv2devices.c b/src/util/vircgroupv2devices.c index d62ee12a05..997ef82964 100644 --- a/src/util/vircgroupv2devices.c +++ b/src/util/vircgroupv2devices.c @@ -541,12 +541,13 @@ virCgroupV2DevicesPrepareProg(virCgroupPtr group) int virCgroupV2DevicesRemoveProg(virCgroupPtr group) { - if (virCgroupV2DevicesDetectProg(group) < 0) - return -1; - if (group->unified.devices.progfd <=3D 0 && group->unified.devices.map= fd <=3D 0) return 0; =20 + if (virCgroupV2DevicesDetectProg(group) < 0) { + return -1; + } + if (group->unified.devices.mapfd >=3D 0) VIR_FORCE_CLOSE(group->unified.devices.mapfd); =20 --=20 2.26.0.rc2.42.g98cedd0233