[libvirt] [PATCH] vircgroup: fix partition creation for cgroups v2 without systemd
by Pavel Hrdina
On hosts without systemd libvirt is responsible for creating cgroups
topology. With cgroups v2 the logic changed a bit. If we need to
create new directory the detection of controllers fails because the
directory doesn't exists so there is no cgroup.controllers file.
To fix that issue we need to have a parent cgroup where we can look
into cgroup.subtree_control to get a list of enabled controllers.
To fix the issue reorder the operations to get a parent group fist so
we can use it to create a new partition.
<https://www.redhat.com/archives/libvir-list/2019-July/msg01309.html>
Reported-by: Raghav Gururajan <rvgn(a)disroot.org>
Signed-off-by: Pavel Hrdina <phrdina(a)redhat.com>
---
src/util/vircgroup.c | 35 +++++++++++++++++++----------------
1 file changed, 19 insertions(+), 16 deletions(-)
diff --git a/src/util/vircgroup.c b/src/util/vircgroup.c
index 825f62a97b..0789630b47 100644
--- a/src/util/vircgroup.c
+++ b/src/util/vircgroup.c
@@ -842,6 +842,7 @@ virCgroupNewPartition(const char *path,
virCgroupPtr *group)
{
int ret = -1;
+ char *tmp;
VIR_AUTOFREE(char *) parentPath = NULL;
VIR_AUTOFREE(char *) newPath = NULL;
virCgroupPtr parent = NULL;
@@ -858,25 +859,27 @@ virCgroupNewPartition(const char *path,
if (virCgroupSetPartitionSuffix(path, &newPath) < 0)
goto cleanup;
- if (virCgroupNew(-1, newPath, NULL, controllers, group) < 0)
+ if (STREQ(newPath, "/")) {
+ ret = 0;
goto cleanup;
-
- if (STRNEQ(newPath, "/")) {
- char *tmp;
- if (VIR_STRDUP(parentPath, newPath) < 0)
- goto cleanup;
-
- tmp = strrchr(parentPath, '/');
- tmp++;
- *tmp = '\0';
-
- if (virCgroupNew(-1, parentPath, NULL, controllers, &parent) < 0)
- goto cleanup;
-
- if (virCgroupMakeGroup(parent, *group, create, VIR_CGROUP_NONE) < 0)
- goto cleanup;
}
+ if (VIR_STRDUP(parentPath, newPath) < 0)
+ goto cleanup;
+
+ tmp = strrchr(parentPath, '/');
+ tmp++;
+ *tmp = '\0';
+
+ if (virCgroupNew(-1, parentPath, NULL, controllers, &parent) < 0)
+ goto cleanup;
+
+ if (virCgroupNew(-1, newPath, parent, controllers, group) < 0)
+ goto cleanup;
+
+ if (virCgroupMakeGroup(parent, *group, create, VIR_CGROUP_NONE) < 0)
+ goto cleanup;
+
ret = 0;
cleanup:
if (ret != 0)
--
2.21.0
5 years, 8 months
[libvirt] [PATCH] news: add entry for new max_threads_per_process option in qemu.conf
by Jim Fehlig
Signed-off-by: Jim Fehlig <jfehlig(a)suse.com>
---
docs/news.xml | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/docs/news.xml b/docs/news.xml
index 82a4ec9c84..3a20f95a0d 100644
--- a/docs/news.xml
+++ b/docs/news.xml
@@ -74,6 +74,17 @@
which portions of a disk have changed since a point in time.
</description>
</change>
+ <change>
+ <summary>
+ qemu: Add support for overriding max threads per process limit
+ </summary>
+ <description>
+ systemd-based systems impose a limit on the number of threads a
+ process can spawn, which in some cases can be exceeded by qemu
+ processes running VMs. Add a <code>max_threads_per_process</code>
+ option to qemu.conf to override the system default.
+ </description>
+ </change>
</section>
<section title="Removed features">
<change>
--
2.22.0
5 years, 8 months