From nobody Sun May 5 18:04:31 2024 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=1666690923; cv=none; d=zohomail.com; s=zohoarc; b=kM3dNU4H/Numw1Lh9j875TWpTAKOXR2FeqTwigQhqr+cTQZLt+qAAK1OLlxNeDLt9rmAwtLZ/a3snFJnxqpf1GpYi2ZsGAA04BmoEyVTV9tg5eHm4ZR/DdMg/I9M22UvSadf6QLDZhFaiutNSsrCsPGVhVIJu60DKZMjKLyAlNE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1666690923; 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=R9WIoxsw01OaNmMpGC6M7KXucH0MbFkHS4kt82dY4Ug=; b=D2U5iQLJSb96WZUPqAaIaigFGFf2KI0hROQB3Lr3QYCZneHUlQ9nk5P/OonyfZaIbFRljUX9OhRIceIurwof6BVZ87yn1hDzJuofvrnbp59/DtdvNcRG+O5QFo3GJaLo0tmkp1hIparDwPakuErIEl1v9K5iUBuylxW87EragfM= 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 1666690923206734.4465865697927; Tue, 25 Oct 2022 02:42:03 -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-116-yEYejtiZMlmL7JPX7nO2IQ-1; Tue, 25 Oct 2022 05:40:55 -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 79D90833AFD; 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 63E6E4EA49; 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 B52EA194705D; Tue, 25 Oct 2022 09:40:52 +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 281781946597 for ; Tue, 25 Oct 2022 09:40:52 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 0BF3620290A6; 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 98F1020290A5 for ; Tue, 25 Oct 2022 09:40:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1666690922; 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=R9WIoxsw01OaNmMpGC6M7KXucH0MbFkHS4kt82dY4Ug=; b=LbFnaf8uKlNxnxs+nH5BSiLZDjqBl5xo4ZZv334Z0rqfqid0cQshygDPhQBIymFnlDvGxR 3PlLqFEXIbygEFb9RPXo946HZom8IFQh4KEoaLKy9OuTIDMoBPbS8pF/WFK3kmvl+HlzIS ppm2VT75A8pyGwhxYpul1y0GtDTzPjs= X-MC-Unique: yEYejtiZMlmL7JPX7nO2IQ-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Pavel Hrdina To: libvir-list@redhat.com Subject: [libvirt PATCH 1/2] Revert "vircgroup: Remove unused variables in virCgroupV2Available" Date: Tue, 25 Oct 2022 11:40:42 +0200 Message-Id: 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: 1666690924267100001 Content-Type: text/plain; charset="utf-8"; x-default="true" This reverts commit e49313b54ed2a149c71f9073659222742ff3ffb0. We are going to revert commit a0f37232b9c4296ca16955cc625f75eb848ace39 as well so we need to revert this fix of that commit first. Signed-off-by: Pavel Hrdina --- src/util/vircgroupv2.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/util/vircgroupv2.c b/src/util/vircgroupv2.c index bf6bd11fef..0e0c61d466 100644 --- a/src/util/vircgroupv2.c +++ b/src/util/vircgroupv2.c @@ -69,6 +69,9 @@ virCgroupV2Available(void) return false; =20 while (getmntent_r(mounts, &entry, buf, sizeof(buf)) !=3D NULL) { + g_autofree char *contFile =3D NULL; + g_autofree char *contStr =3D NULL; + if (STRNEQ(entry.mnt_type, "cgroup2")) continue; =20 --=20 2.37.3 From nobody Sun May 5 18:04:31 2024 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