From nobody Sun Feb 8 11:16:33 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=1604407331; cv=none; d=zohomail.com; s=zohoarc; b=U6z94DmbYXR1ejX2mL2gfjwc2+XMDWGQ2AzOCnsDu1GFaX2gB/Qh1ps/BLDysVJeB8bdj1q4Gz1Kj1984LQRtfStCJew1KBbBz86FLgxOQprNhU1YzXwr56RjptrU9+7RcxVbcB+KttRVNon+KSN8TE2TD9KdypvRN3bCmTiUOY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1604407331; 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=KdVfjaZoSpZMZStWtiXAqiH1lpBzggIafNz57pEXotI=; b=ccfOmb0kbGp0sKpRPKR2zqMLeQtkafuyXecb2nJ1Xe77vJ9BhY/7M4d1Yv5or4wZRGYSM+8uZc+EDCwUGoF8w9cqcjtNn+ZPwSMxTwVGS5q5OCcmbVlUzymTZFdOE/5+H9vBvDiG6OoHoqjK5Pic37Z9piqp50nQhCFiTxkSc0c= 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 1604407331975312.4240558519016; Tue, 3 Nov 2020 04:42:11 -0800 (PST) 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-2-chOIHB5nPF2TUK4j-oGYJg-1; Tue, 03 Nov 2020 07:42:07 -0500 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 352365708A; Tue, 3 Nov 2020 12:42:02 +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 070E421E9D; Tue, 3 Nov 2020 12:42:02 +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 C4C758C7CA; Tue, 3 Nov 2020 12:42:01 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 0A3CfllC015879 for ; Tue, 3 Nov 2020 07:41:47 -0500 Received: by smtp.corp.redhat.com (Postfix) id AA99073661; Tue, 3 Nov 2020 12:41:47 +0000 (UTC) Received: from antique-work.redhat.com (unknown [10.40.192.11]) by smtp.corp.redhat.com (Postfix) with ESMTP id 241481C4 for ; Tue, 3 Nov 2020 12:41:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1604407330; 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=KdVfjaZoSpZMZStWtiXAqiH1lpBzggIafNz57pEXotI=; b=TsEYHVcgym6IE5MM7MySsHzdCG4vDTQb3F5ag9nWlyWAzuTWPCwccMCBwY2FE0P9Lgf4EX m6gqyd3+62JguzCnJJfCnQVKwGYxchkhEdKYwI81M8DyZ/Yhtyt4k87jmf9kQ44Z4fEgIo hslmEsK1LhyQn2sw4CIaTyWd1BbY0mY= X-MC-Unique: chOIHB5nPF2TUK4j-oGYJg-1 From: Pavel Hrdina To: libvir-list@redhat.com Subject: [libvirt PATCH 06/25] vircgroupv2: detect controllers enabled in parent cgroup Date: Tue, 3 Nov 2020 13:41:18 +0100 Message-Id: <374ea88fe567f4a25cd1b3fb17a3dba865b8133b.1604407065.git.phrdina@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 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" With cgroups v2 working with controllers is a bit more complicated then with cgroups v1 where the controller had to be mounted. There are two files, cgroups.controllers and cgroup.subtree_control. The file cgroup.controllers lists all controllers enabled in the current cgroup and cgroups.subtree_control, as the name suggest, controls which controllers are enabled for a subtree of cgroups. Now the issue here is that the current code doesn't make any difference if the @parent variable is NULL or not because ../cgroup.subtree_control will list the same controllers as ./cgroup.controllers. The whole point of the @parent variable is when we are building the cgroup topology ourselves without systemd help we need to detect which controllers are enabled in the parent cgroup in order to enable them for the current cgroup as well and for that we need to check cgroup.controllers of the parent group. Signed-off-by: Pavel Hrdina --- src/util/vircgroupv2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util/vircgroupv2.c b/src/util/vircgroupv2.c index fb97b7fd2a..530e5d2ce9 100644 --- a/src/util/vircgroupv2.c +++ b/src/util/vircgroupv2.c @@ -255,7 +255,7 @@ virCgroupV2ParseControllersFile(virCgroupPtr group, char **tmp; =20 if (parent) { - contFile =3D g_strdup_printf("%s%s/cgroup.subtree_control", + contFile =3D g_strdup_printf("%s%s/cgroup.controllers", parent->unified.mountPoint, NULLSTR_EMPTY(parent->unified.placement= )); } else { --=20 2.26.2