From nobody Thu Sep 19 01:09:55 2024 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 1537273108027430.52645295853006; Tue, 18 Sep 2018 05:18:28 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.25]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C810EC05D3E4; Tue, 18 Sep 2018 12:18:25 +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 90C7B2010D05; Tue, 18 Sep 2018 12:18:25 +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 41029181A130; Tue, 18 Sep 2018 12:18:25 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w8ICI7Np015739 for ; Tue, 18 Sep 2018 08:18:07 -0400 Received: by smtp.corp.redhat.com (Postfix) id 8DA5A176AD; Tue, 18 Sep 2018 12:18:07 +0000 (UTC) Received: from antique-work.brq.redhat.com (unknown [10.43.2.181]) by smtp.corp.redhat.com (Postfix) with ESMTP id 116EE176AC for ; Tue, 18 Sep 2018 12:18:06 +0000 (UTC) From: Pavel Hrdina To: libvir-list@redhat.com Date: Tue, 18 Sep 2018 14:17:55 +0200 Message-Id: <3e0932c6b17c16d7cdfff46ffa9bb79d53985d6c.1537273033.git.phrdina@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 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: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.25 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Tue, 18 Sep 2018 12:18:26 +0000 (UTC) X-ZohoMail: RDMRC_0 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" In cgroup v2 we need to handle processes and threads differently, following patch will introduce virCgroupAddThread. Signed-off-by: Pavel Hrdina Reviewed-by: Fabiano Fid=C3=AAncio --- 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 4e84391bf5..4ead2dc9f0 100644 --- a/src/lxc/lxc_controller.c +++ b/src/lxc/lxc_controller.c @@ -875,12 +875,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 2328957818..cf510fb019 100644 --- a/src/util/vircgroup.c +++ b/src/util/vircgroup.c @@ -1183,35 +1183,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); } @@ -1592,7 +1592,7 @@ virCgroupNewMachineSystemd(const char *name, goto error; } =20 - if (virCgroupAddTask(*group, pidleader) < 0) + if (virCgroupAddProcess(*group, pidleader) < 0) goto error; =20 return 0; @@ -1648,7 +1648,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); @@ -4198,8 +4198,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"= )); @@ -4208,8 +4208,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