]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
vircgroup: Simplify if conditions in virCgroupMakeGroup
authorPavel Hrdina <phrdina@redhat.com>
Sun, 19 Aug 2018 09:04:52 +0000 (11:04 +0200)
committerPavel Hrdina <phrdina@redhat.com>
Mon, 27 Aug 2018 15:40:17 +0000 (17:40 +0200)
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
src/util/vircgroup.c

index dde9ed21a2dfe51bf4d66d72d7be87c53cd59e9c..02de33f74f2f6000c8e3db474cdc0b22b5789a4d 100644 (file)
@@ -1079,24 +1079,20 @@ virCgroupMakeGroup(virCgroupPtr parent,
                     goto error;
                 }
             }
-            if (group->controllers[VIR_CGROUP_CONTROLLER_CPUSET].mountPoint != NULL &&
-                (i == VIR_CGROUP_CONTROLLER_CPUSET ||
-                 STREQ(group->controllers[i].mountPoint,
-                       group->controllers[VIR_CGROUP_CONTROLLER_CPUSET].mountPoint))) {
-                if (virCgroupCpuSetInherit(parent, group) < 0)
-                    goto error;
+            if (i == VIR_CGROUP_CONTROLLER_CPUSET &&
+                group->controllers[i].mountPoint != NULL &&
+                virCgroupCpuSetInherit(parent, group) < 0) {
+                goto error;
             }
             /*
              * Note that virCgroupSetMemoryUseHierarchy should always be
              * called prior to creating subcgroups and attaching tasks.
              */
             if ((flags & VIR_CGROUP_MEM_HIERACHY) &&
-                (group->controllers[VIR_CGROUP_CONTROLLER_MEMORY].mountPoint != NULL) &&
-                (i == VIR_CGROUP_CONTROLLER_MEMORY ||
-                 STREQ(group->controllers[i].mountPoint,
-                       group->controllers[VIR_CGROUP_CONTROLLER_MEMORY].mountPoint))) {
-                if (virCgroupSetMemoryUseHierarchy(group) < 0)
-                    goto error;
+                i == VIR_CGROUP_CONTROLLER_MEMORY &&
+                group->controllers[i].mountPoint != NULL &&
+                virCgroupSetMemoryUseHierarchy(group) < 0) {
+                goto error;
             }
         }
     }