gnu: Add kafs-client
[jackhill/guix/guix.git] / gnu / packages / patches / libvirt-create-machine-cgroup.patch
1 From 9ca0b2955edea162b255b428e493cd8ffac52167 Mon Sep 17 00:00:00 2001
2 From: =?UTF-8?q?Miguel=20=C3=81ngel=20Arruga=20Vivas?=
3 <rosen644835@gmail.com>
4 Date: Fri, 1 Nov 2019 17:29:00 +0100
5 Subject: [PATCH] vircgroup: Ensure /machine group is associated with its
6 parent.
7
8 Call first virCgroupNew on the parent group virCgroupNewPartition if
9 it is available on before the creation of the child group. This
10 ensures that the creation of a first level group on the unified
11 architecture, as the check at virCgroupV2ParseControllersFile as the
12 parent file is there.
13
14 Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1760233
15 ---
16 src/util/vircgroup.c | 8 +++++---
17 1 file changed, 5 insertions(+), 3 deletions(-)
18
19 diff --git a/src/util/vircgroup.c b/src/util/vircgroup.c
20 index b46f20abfd..33c61f2d45 100644
21 --- a/src/util/vircgroup.c
22 +++ b/src/util/vircgroup.c
23 @@ -855,9 +855,6 @@ virCgroupNewPartition(const char *path,
24 if (virCgroupSetPartitionSuffix(path, &newPath) < 0)
25 goto cleanup;
26
27 - if (virCgroupNew(-1, newPath, NULL, controllers, group) < 0)
28 - goto cleanup;
29 -
30 if (STRNEQ(newPath, "/")) {
31 char *tmp;
32 parentPath = g_strdup(newPath);
33 @@ -868,7 +865,12 @@ virCgroupNewPartition(const char *path,
34
35 if (virCgroupNew(-1, parentPath, NULL, controllers, &parent) < 0)
36 goto cleanup;
37 + }
38
39 + if (virCgroupNew(-1, newPath, parent, controllers, group) < 0)
40 + goto cleanup;
41 +
42 + if (parent) {
43 if (virCgroupMakeGroup(parent, *group, create, VIR_CGROUP_NONE) < 0)
44 goto cleanup;
45 }
46 --
47 2.23.0
48