From nobody Mon Feb 9 00:56:29 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 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1537433691088705.3983138908605; Thu, 20 Sep 2018 01:54:51 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 16FC2308421C; Thu, 20 Sep 2018 08:54:49 +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 D06317EBD8; Thu, 20 Sep 2018 08:54:48 +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 89545181A13B; Thu, 20 Sep 2018 08:54:48 +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 w8K8siCc002121 for ; Thu, 20 Sep 2018 04:54:44 -0400 Received: by smtp.corp.redhat.com (Postfix) id 2FF9460851; Thu, 20 Sep 2018 08:54:44 +0000 (UTC) Received: from antique-work.brq.redhat.com (unknown [10.43.2.181]) by smtp.corp.redhat.com (Postfix) with ESMTP id A6099808CB for ; Thu, 20 Sep 2018 08:54:43 +0000 (UTC) From: Pavel Hrdina To: libvir-list@redhat.com Date: Thu, 20 Sep 2018 10:54:32 +0200 Message-Id: <4663494c913aa6b055ae4bfebafbabd86a75843c.1537433421.git.phrdina@redhat.com> In-Reply-To: References: 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 Subject: [libvirt] [PATCH v2 3/9] vircgroup: rename virCgroupAdd.*Task to virCgroupAdd.*Process 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-Type: text/plain; charset="utf-8" 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.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.40]); Thu, 20 Sep 2018 08:54:49 +0000 (UTC) X-ZohoMail: RDMRC_0 RSF_0 Z_629925259 SPT_0 In cgroup v2 we need to handle processes and threads differently, following patch will introduce virCgroupAddThread. Reviewed-by: Fabiano Fid=C3=AAncio Signed-off-by: Pavel Hrdina Reviewed-by: J=EF=BF=BDn Tomko --- src/libvirt-lxc.c | 2 +- src/libvirt_private.syms | 4 ++-- src/lxc/lxc_controller.c | 4 ++-- src/qemu/qemu_process.c | 4 ++-- src/qemu/qemu_tpm.c | 2 +- src/util/vircgroup.c | 32 ++++++++++++++++---------------- src/util/vircgroup.h | 4 ++-- 7 files changed, 26 insertions(+), 26 deletions(-) diff --git a/src/libvirt-lxc.c b/src/libvirt-lxc.c index c9f2146487..9bf0174b95 100644 --- a/src/libvirt-lxc.c +++ b/src/libvirt-lxc.c @@ -306,7 +306,7 @@ int virDomainLxcEnterCGroup(virDomainPtr domain, if (virCgroupNewDetect(domain->id, -1, &cgroup) < 0) goto error; =20 - if (virCgroupAddTask(cgroup, getpid()) < 0) + if (virCgroupAddProcess(cgroup, getpid()) < 0) goto error; =20 virCgroupFree(&cgroup); diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index b9dabfef1b..eac66b0174 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -1498,8 +1498,8 @@ virBufferVasprintf; =20 =20 # util/vircgroup.h -virCgroupAddMachineTask; -virCgroupAddTask; +virCgroupAddMachineProcess; +virCgroupAddProcess; virCgroupAllowAllDevices; virCgroupAllowDevice; virCgroupAllowDevicePath; diff --git a/src/lxc/lxc_controller.c b/src/lxc/lxc_controller.c index d81c8e946d..62dfd09473 100644 --- a/src/lxc/lxc_controller.c +++ b/src/lxc/lxc_controller.c @@ -874,12 +874,12 @@ static int virLXCControllerSetupCgroupLimits(virLXCCo= ntrollerPtr ctrl) ctrl->nicindexes))) goto cleanup; =20 - if (virCgroupAddMachineTask(ctrl->cgroup, getpid()) < 0) + if (virCgroupAddMachineProcess(ctrl->cgroup, getpid()) < 0) goto cleanup; =20 /* Add all qemu-nbd tasks to the cgroup */ for (i =3D 0; i < ctrl->nnbdpids; i++) { - if (virCgroupAddMachineTask(ctrl->cgroup, ctrl->nbdpids[i]) < 0) + if (virCgroupAddMachineProcess(ctrl->cgroup, ctrl->nbdpids[i]) < 0) goto cleanup; } =20 diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 72a59dec55..249dac39f2 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -2549,7 +2549,7 @@ qemuProcessSetupPid(virDomainObjPtr vm, goto cleanup; =20 /* Move the thread to the sub dir */ - if (virCgroupAddTask(cgroup, pid) < 0) + if (virCgroupAddProcess(cgroup, pid) < 0) goto cleanup; =20 } @@ -2787,7 +2787,7 @@ qemuProcessStartManagedPRDaemon(virDomainObjPtr vm) } =20 if (priv->cgroup && - virCgroupAddMachineTask(priv->cgroup, cpid) < 0) + virCgroupAddMachineProcess(priv->cgroup, cpid) < 0) goto cleanup; =20 if (qemuSecurityDomainSetPathLabel(driver, vm, socketPath, true) < 0) diff --git a/src/qemu/qemu_tpm.c b/src/qemu/qemu_tpm.c index 278b262c48..c64114feac 100644 --- a/src/qemu/qemu_tpm.c +++ b/src/qemu/qemu_tpm.c @@ -905,7 +905,7 @@ qemuExtTPMSetupCgroup(virQEMUDriverPtr driver, _("Could not get process id of swtpm")); goto cleanup; } - if (virCgroupAddTask(cgroup, pid) < 0) + if (virCgroupAddProcess(cgroup, pid) < 0) goto cleanup; break; case VIR_DOMAIN_TPM_TYPE_PASSTHROUGH: diff --git a/src/util/vircgroup.c b/src/util/vircgroup.c index 13f5e0d83a..30ffb658d9 100644 --- a/src/util/vircgroup.c +++ b/src/util/vircgroup.c @@ -1179,35 +1179,35 @@ virCgroupAddTaskInternal(virCgroupPtr group, pid_t = pid, bool withSystemd) } =20 /** - * virCgroupAddTask: + * virCgroupAddProcess: * - * @group: The cgroup to add a task to - * @pid: The pid of the task to add + * @group: The cgroup to add a process to + * @pid: The pid of the process to add * - * Will add the task to all controllers, except the + * Will add the process to all controllers, except the * systemd unit controller. * * Returns: 0 on success, -1 on error */ int -virCgroupAddTask(virCgroupPtr group, pid_t pid) +virCgroupAddProcess(virCgroupPtr group, pid_t pid) { return virCgroupAddTaskInternal(group, pid, false); } =20 /** - * virCgroupAddMachineTask: + * virCgroupAddMachineProcess: * - * @group: The cgroup to add a task to - * @pid: The pid of the task to add + * @group: The cgroup to add a process to + * @pid: The pid of the process to add * - * Will add the task to all controllers, including the + * Will add the process to all controllers, including the * systemd unit controller. * * Returns: 0 on success, -1 on error */ int -virCgroupAddMachineTask(virCgroupPtr group, pid_t pid) +virCgroupAddMachineProcess(virCgroupPtr group, pid_t pid) { return virCgroupAddTaskInternal(group, pid, true); } @@ -1588,7 +1588,7 @@ virCgroupNewMachineSystemd(const char *name, goto error; } =20 - if (virCgroupAddTask(*group, pidleader) < 0) + if (virCgroupAddProcess(*group, pidleader) < 0) goto error; =20 return 0; @@ -1644,7 +1644,7 @@ virCgroupNewMachineManual(const char *name, group) < 0) goto cleanup; =20 - if (virCgroupAddTask(*group, pidleader) < 0) { + if (virCgroupAddProcess(*group, pidleader) < 0) { virErrorPtr saved =3D virSaveLastError(); virCgroupRemove(*group); virCgroupFree(group); @@ -4194,8 +4194,8 @@ virCgroupPathOfController(virCgroupPtr group ATTRIBUT= E_UNUSED, =20 =20 int -virCgroupAddTask(virCgroupPtr group ATTRIBUTE_UNUSED, - pid_t pid ATTRIBUTE_UNUSED) +virCgroupAddProcess(virCgroupPtr group ATTRIBUTE_UNUSED, + pid_t pid ATTRIBUTE_UNUSED) { virReportSystemError(ENXIO, "%s", _("Control groups not supported on this platform"= )); @@ -4204,8 +4204,8 @@ virCgroupAddTask(virCgroupPtr group ATTRIBUTE_UNUSED, =20 =20 int -virCgroupAddMachineTask(virCgroupPtr group ATTRIBUTE_UNUSED, - pid_t pid ATTRIBUTE_UNUSED) +virCgroupAddMachineProcess(virCgroupPtr group ATTRIBUTE_UNUSED, + pid_t pid ATTRIBUTE_UNUSED) { virReportSystemError(ENXIO, "%s", _("Control groups not supported on this platform"= )); diff --git a/src/util/vircgroup.h b/src/util/vircgroup.h index ee3b7c7222..bbd4c2ed57 100644 --- a/src/util/vircgroup.h +++ b/src/util/vircgroup.h @@ -118,8 +118,8 @@ int virCgroupPathOfController(virCgroupPtr group, const char *key, char **path); =20 -int virCgroupAddTask(virCgroupPtr group, pid_t pid); -int virCgroupAddMachineTask(virCgroupPtr group, pid_t pid); +int virCgroupAddProcess(virCgroupPtr group, pid_t pid); +int virCgroupAddMachineProcess(virCgroupPtr group, pid_t pid); =20 int virCgroupSetBlkioWeight(virCgroupPtr group, unsigned int weight); int virCgroupGetBlkioWeight(virCgroupPtr group, unsigned int *weight); --=20 2.17.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list