From nobody Sat Feb 7 10:16:18 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.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 216.205.24.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=1604407341; cv=none; d=zohomail.com; s=zohoarc; b=bx6tXc7pfbXVSRaXZhWYWAGU5YcYk/wL7CyEjzO1aF5aedAb7m81EDm3dlhCW6IU5d04DNXmwz6xIi6Gp7AYdV+6raJ36T6vtDA71Qbho35ihKhpPAFxAQdDMiHIiso5laZsdDDmLFTvLsgvPvzkR+mxNNfV/7TjN7380zZvg78= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1604407341; 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=UoZKCfnz0BGbrlUFatnxChF9dYNPZAnl1Ua9/AM8EKw=; b=MmId1X4sRRqMK4SQLEDB7ME7Z+dK5vuqozUK7+9WaN75A3J6bqm4zKvFCjD6PFEk7E3p1QOhd+JYzZAbhecCRCgiufROlU+rcMMpDHVjWcihMiPVt+adc/rNWoFqU6d1uExIRJm3C+jyTXSDAv1b2nGGu8RzJaWrzH0A3UhYFpQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.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 [216.205.24.124]) by mx.zohomail.com with SMTPS id 1604407341946445.3682405264566; Tue, 3 Nov 2020 04:42:21 -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-157-2HeqA_4VPWCN1EL3TLujUg-1; Tue, 03 Nov 2020 07:42:18 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 9AEE68049E7; Tue, 3 Nov 2020 12:42:10 +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 764265D990; Tue, 3 Nov 2020 12:42:10 +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 4369A8C7D8; Tue, 3 Nov 2020 12:42:10 +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 0A3CfoBB015911 for ; Tue, 3 Nov 2020 07:41:50 -0500 Received: by smtp.corp.redhat.com (Postfix) id 6244573661; Tue, 3 Nov 2020 12:41:50 +0000 (UTC) Received: from antique-work.redhat.com (unknown [10.40.192.11]) by smtp.corp.redhat.com (Postfix) with ESMTP id D1BCA1C4 for ; Tue, 3 Nov 2020 12:41:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1604407340; 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=UoZKCfnz0BGbrlUFatnxChF9dYNPZAnl1Ua9/AM8EKw=; b=gVdbuptWj5O1EjqR8YgvMdJ3vR8Q/dcS2MknzFGNpKu5Uz6Qs3GmajeZOhMY/ZpmB5NrZf jShMAXUXYwNGwkiuFAeT1uw/5b7lCs29xHfd36cQ5DZ/Uc7tb/qAwe2aob2U7EzrsEbqtB PYCocyvSdZKsS2TO2+lAD5us8ABbyKU= X-MC-Unique: 2HeqA_4VPWCN1EL3TLujUg-1 From: Pavel Hrdina To: libvir-list@redhat.com Subject: [libvirt PATCH 09/25] vircgroup: introduce virCgroupCopyMounts helper Date: Tue, 3 Nov 2020 13:41:21 +0100 Message-Id: <41cd051ff19261b49e3f77d2d4dcaeebf3ffdbe9.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.14 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" Signed-off-by: Pavel Hrdina --- src/util/vircgroup.c | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/src/util/vircgroup.c b/src/util/vircgroup.c index 3db20ed262..a30aec4e5e 100644 --- a/src/util/vircgroup.c +++ b/src/util/vircgroup.c @@ -239,6 +239,23 @@ virCgroupSetBackends(virCgroupPtr group) } =20 =20 +static int +virCgroupCopyMounts(virCgroupPtr group, + virCgroupPtr parent) +{ + size_t i; + + for (i =3D 0; i < VIR_CGROUP_BACKEND_TYPE_LAST; i++) { + if (group->backends[i] && + group->backends[i]->copyMounts(group, parent) < 0) { + return -1; + } + } + + return 0; +} + + /* * Process /proc/mounts figuring out what controllers are * mounted and where @@ -375,12 +392,8 @@ virCgroupDetect(virCgroupPtr group, return -1; =20 if (parent) { - for (i =3D 0; i < VIR_CGROUP_BACKEND_TYPE_LAST; i++) { - if (group->backends[i] && - group->backends[i]->copyMounts(group, parent) < 0) { - return -1; - } - } + if (virCgroupCopyMounts(group, parent) < 0) + return -1; } else { if (virCgroupDetectMounts(group) < 0) return -1; --=20 2.26.2