From nobody Sun Feb 8 11:22:03 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=1604407390; cv=none; d=zohomail.com; s=zohoarc; b=CCG9xHkL44KTXwfmwPmsBaOoWcPqsDw2B6iB7GIlC/gO7TDV32NARUJ1RWW3WxqW4YhM/6sZKTmUSqZBWlN8XaxPLkz7dGG6g3CDhTYXgd9ggvo6KbqhYFpBjQqjx6iUonwiDS+VRb7Irmaqa0xE5Mx0y7OrmM/AdNi/Kus3iB8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1604407390; 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=I2J0jWI2t4vWmA4pNf38X/aM5fjK3oFt4sz/opXAz08=; b=KCrqOlkun8m7WE3Obi9alaF8chITWCPZYgtnDEr6wMnaBgXMtOKXOuhLO+dW80/vNagzIoujP0Ss/NihKH7ZRblSrZzsIRrZD/zeNdxfqViTTWHxuvPfMbc2UfDGVnYicRc9VJDLkdwGBUyxOpD0KfQoy3YWbzQsFh1uitjmAyg= 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 1604407390338459.7456190205569; Tue, 3 Nov 2020 04:43:10 -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-451-C60h1dmbPJaTLizmpPbEzw-1; Tue, 03 Nov 2020 07:42:10 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 3A15C803F49; 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 169D37512E; 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 C38E78C7C9; 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 0A3CfjdR015854 for ; Tue, 3 Nov 2020 07:41:45 -0500 Received: by smtp.corp.redhat.com (Postfix) id DB95A73661; Tue, 3 Nov 2020 12:41:45 +0000 (UTC) Received: from antique-work.redhat.com (unknown [10.40.192.11]) by smtp.corp.redhat.com (Postfix) with ESMTP id 55F5B1C4 for ; Tue, 3 Nov 2020 12:41:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1604407389; 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=I2J0jWI2t4vWmA4pNf38X/aM5fjK3oFt4sz/opXAz08=; b=aKLp4Rir46pKqWZw/rqqhwOch6kl7+LXAG9zX/x8bL0V5JFfSevtEVMMxo0ODS4Ch/2lOK cB5wlHCyu31u8SHIhiqtzFTZofSSbeSk6Jotv+BMivv6Qft1MOMKogATRg3ZmAzJNLUeZm 2Pkd4OSlB36xu6IZHnHQepiM4kbUM58= X-MC-Unique: C60h1dmbPJaTLizmpPbEzw-1 From: Pavel Hrdina To: libvir-list@redhat.com Subject: [libvirt PATCH 04/25] vircgroupv2: properly detect empty tasks Date: Tue, 3 Nov 2020 13:41:16 +0100 Message-Id: <779e0df0e5408364ff0e22189dbe7001e0c2eba2.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.79 on 10.5.11.15 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 the file cgroup.procs will never be empty if threading is enabled as it will always have ID of all processes even if all threads of the processes are moved to sub-cgroups. If that happens the file cgroup.threads will be empty. 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 285b7675d9..65f5cc6bd0 100644 --- a/src/util/vircgroupv2.c +++ b/src/util/vircgroupv2.c @@ -521,7 +521,7 @@ virCgroupV2HasEmptyTasks(virCgroupPtr cgroup, int ret =3D -1; g_autofree char *content =3D NULL; =20 - ret =3D virCgroupGetValueStr(cgroup, controller, "cgroup.procs", &cont= ent); + ret =3D virCgroupGetValueStr(cgroup, controller, "cgroup.threads", &co= ntent); =20 if (ret =3D=3D 0 && content[0] =3D=3D '\0') ret =3D 1; --=20 2.26.2