From nobody Sun Feb 8 13:39:41 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 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=1561124257; cv=none; d=zoho.com; s=zohoarc; b=OLL1HsplzE5iYzN/IcipSCut7rjBvSI1IdGKB4d/AuWsm5DquoSfd1gI8uWoAtyWNSgM1Si1rtaaJJdqCGQJnrD8ovm9HCvdf7U80yiB8X0LP/tXUIgi0ZEMexwYvtRcFZHUM2ztOUbD87dne9N1sX3YbMEixKNAOZR1DSBPhV4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1561124257; 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:ARC-Authentication-Results; bh=ZBpz/F8es0oe4LnuZsw7es53eb5FVY9n1VHpABaWHgI=; b=TcbVIDXE+hXG92a1S2jE6YOTmXgEDzHwBpWiseS5AgCEiUB3zbqKOAkwDG2twXmPR0PmXSiO7abw6pGNxnNtxx19Qk1fgpqMvZmWQY/8EzY6Ldrz9V+ZdHRGzKP+fslA4zIBUfBeZXyPpjOOQQVRKl/Nx13mZLBl9hu9Lk/OJsM= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1561124257250195.20539113949326; Fri, 21 Jun 2019 06:37:37 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1D38CBAFD; Fri, 21 Jun 2019 13:37:27 +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 E7C2860920; Fri, 21 Jun 2019 13:37:26 +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 AF3881806B19; Fri, 21 Jun 2019 13:37:23 +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 x5LDWsFB019572 for ; Fri, 21 Jun 2019 09:32:54 -0400 Received: by smtp.corp.redhat.com (Postfix) id 841CF5D9E5; Fri, 21 Jun 2019 13:32:54 +0000 (UTC) Received: from antique-work.brq.redhat.com (unknown [10.43.2.63]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0E3155D9D2 for ; Fri, 21 Jun 2019 13:32:53 +0000 (UTC) From: Pavel Hrdina To: libvir-list@redhat.com Date: Fri, 21 Jun 2019 15:32:46 +0200 Message-Id: <1f7c6bad65c6ec12b346b3106d735774d0ed2591.1561123744.git.phrdina@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v2 6/6] util: vircgroupv2: don't error out if enabling controller fails 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: , Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Fri, 21 Jun 2019 13:37:35 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Currently CPU controller cannot be enabled if there is any real-time task running and is assigned to non-root cgroup which is the case on several distributions with graphical environment. Instead of erroring out treat it as the controller is not available. Signed-off-by: Pavel Hrdina --- Changes in v2: - Reworked error reporting to virResetLastError only if we fail to enable controller. The error message will be still logged but now it's more descriptive what have failed. src/util/vircgroupv2.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/util/vircgroupv2.c b/src/util/vircgroupv2.c index 133a8e0e66..348c12d5c6 100644 --- a/src/util/vircgroupv2.c +++ b/src/util/vircgroupv2.c @@ -433,6 +433,8 @@ virCgroupV2MakeGroup(virCgroupPtr parent ATTRIBUTE_UNUS= ED, } else { size_t i; for (i =3D 0; i < VIR_CGROUP_CONTROLLER_LAST; i++) { + int rc; + if (!virCgroupV2HasController(parent, i)) continue; =20 @@ -440,8 +442,17 @@ virCgroupV2MakeGroup(virCgroupPtr parent ATTRIBUTE_UNU= SED, if (i =3D=3D VIR_CGROUP_CONTROLLER_CPUACCT) continue; =20 - if (virCgroupV2EnableController(parent, i) < 0) + rc =3D virCgroupV2EnableController(parent, i); + if (rc < 0) { + if (rc =3D=3D -2) { + virResetLastError(); + VIR_DEBUG("failed to enable '%s' controller, skipp= ing", + virCgroupV2ControllerTypeToString(i)); + group->unified.controllers &=3D ~(1 << i); + continue; + } return -1; + } } } } --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list