From nobody Tue Feb 10 02:49:11 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.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.129.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=1666690860; cv=none; d=zohomail.com; s=zohoarc; b=APi+i/ETnjGE9FDTSXbLyA7M0GeMfaeaGosKn1kyW8xhSztVjty/xF38LGkmbKMcEgQBZjLp8VIS/bJmJfnL4mKxYXn4jx9+3fG/kINMC2A3eljtDadBExwP4f8gqGO/c07RulYnjr/lKwOCkg77TqKoNs9Qa0lKmyaX1l7s5K4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1666690860; 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=zBwW2IL38D58i2enqCW+r0Y16tSeUyWgGmM+X0HokLc=; b=Oxgnd6izhsiy58HNe3fjpYfh875DBrlveUMDBM7ZvtvMBlE0Bc+2MUCb3oMH4nRAMNld8EAXAJlDn6+3TB1zVwFYR6L565dw27x8slq1rV+HQ5sWvT0kx7Gvjuut1ddMih5JmZVQ6pI1cIjkMd0LZoBtJ8PV6HLW4kg49p8DNVY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.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.129.124]) by mx.zohomail.com with SMTPS id 166669086096262.307343980315295; Tue, 25 Oct 2022 02:41:00 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-583-uFlg31K8NcWEQZZwDjsUEg-1; Tue, 25 Oct 2022 05:40:56 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id E09221012461; Tue, 25 Oct 2022 09:40:53 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id CBA724EA49; Tue, 25 Oct 2022 09:40:53 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 8030A19465B2; Tue, 25 Oct 2022 09:40:53 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id C29B71947068 for ; Tue, 25 Oct 2022 09:40:52 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id B295320290A6; Tue, 25 Oct 2022 09:40:52 +0000 (UTC) Received: from localhost.localdomain (ovpn-192-33.brq.redhat.com [10.40.192.33]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4BFB120290A5 for ; Tue, 25 Oct 2022 09:40:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1666690859; 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=zBwW2IL38D58i2enqCW+r0Y16tSeUyWgGmM+X0HokLc=; b=GWjEN41M5dgY6Jx1NXcuZ5qfL9hNibow73+rN5lUS8zULdS851M0Shbzewgp7vciKEcELh kkhaLnFBh5BreUHSBvHcd05avZE+MLW/cqIAHw3OrAIuxTvZghOgKpNd5mGKCpE6//KwGl adw1p5pBTrcsdyXDelmWQepKHigrYDs= X-MC-Unique: uFlg31K8NcWEQZZwDjsUEg-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Pavel Hrdina To: libvir-list@redhat.com Subject: [libvirt PATCH 2/2] Revert "cgroup/LXC: Do not condition availability of v2 by controllers" Date: Tue, 25 Oct 2022 11:40:43 +0200 Message-Id: <02245fa686c1a450716941619fdd30c437dd1b94.1666690720.git.phrdina@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.5 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: 1666690861859100002 Content-Type: text/plain; charset="utf-8"; x-default="true" This reverts commit a0f37232b9c4296ca16955cc625f75eb848ace39. This fix of the issue is incorrect and breaks usage of other controllers in hybrid mode that systemd creates, specifically usage of devices and cpuacct controllers as they are now assumed to be part of the cgroup v2 topology which is not true. We need to find different solution to the issue. Signed-off-by: Pavel Hrdina --- src/util/vircgroup.c | 6 ++---- src/util/vircgroupv2.c | 12 ++++++++++++ 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/src/util/vircgroup.c b/src/util/vircgroup.c index 49ebd37ded..a6a409af3d 100644 --- a/src/util/vircgroup.c +++ b/src/util/vircgroup.c @@ -2921,12 +2921,10 @@ int virCgroupBindMount(virCgroup *group, const char *oldroot, const char *mountopts) { - ssize_t i; + size_t i; virCgroup *parent =3D virCgroupGetNested(group); =20 - /* In hybrid environments, V2 may be mounted over V1. - * Mount the backends in reverse order. */ - for (i =3D VIR_CGROUP_BACKEND_TYPE_LAST - 1; i >=3D 0; i--) { + for (i =3D 0; i < VIR_CGROUP_BACKEND_TYPE_LAST; i++) { if (parent->backends[i] && parent->backends[i]->bindMount(parent, oldroot, mountopts) < 0= ) { return -1; diff --git a/src/util/vircgroupv2.c b/src/util/vircgroupv2.c index 0e0c61d466..4c110940cf 100644 --- a/src/util/vircgroupv2.c +++ b/src/util/vircgroupv2.c @@ -75,10 +75,22 @@ virCgroupV2Available(void) if (STRNEQ(entry.mnt_type, "cgroup2")) continue; =20 + /* Systemd uses cgroup v2 for process tracking but no controller is + * available. We should consider this configuration as cgroup v2 is + * not available. */ + contFile =3D g_strdup_printf("%s/cgroup.controllers", entry.mnt_di= r); + + if (virFileReadAll(contFile, 1024 * 1024, &contStr) < 0) + goto cleanup; + + if (STREQ(contStr, "")) + continue; + ret =3D true; break; } =20 + cleanup: VIR_FORCE_FCLOSE(mounts); return ret; } --=20 2.37.3