提交 0ec8416f 编写于 作者: P Pavel Hrdina

vircgroup: Simplify if conditions in virCgroupMakeGroup

Reviewed-by: NJán Tomko <jtomko@redhat.com>
Signed-off-by: NPavel Hrdina <phrdina@redhat.com>
上级 b013bdfd
...@@ -1079,11 +1079,9 @@ virCgroupMakeGroup(virCgroupPtr parent, ...@@ -1079,11 +1079,9 @@ virCgroupMakeGroup(virCgroupPtr parent,
goto error; goto error;
} }
} }
if (group->controllers[VIR_CGROUP_CONTROLLER_CPUSET].mountPoint != NULL && if (i == VIR_CGROUP_CONTROLLER_CPUSET &&
(i == VIR_CGROUP_CONTROLLER_CPUSET || group->controllers[i].mountPoint != NULL &&
STREQ(group->controllers[i].mountPoint, virCgroupCpuSetInherit(parent, group) < 0) {
group->controllers[VIR_CGROUP_CONTROLLER_CPUSET].mountPoint))) {
if (virCgroupCpuSetInherit(parent, group) < 0)
goto error; goto error;
} }
/* /*
...@@ -1091,11 +1089,9 @@ virCgroupMakeGroup(virCgroupPtr parent, ...@@ -1091,11 +1089,9 @@ virCgroupMakeGroup(virCgroupPtr parent,
* called prior to creating subcgroups and attaching tasks. * called prior to creating subcgroups and attaching tasks.
*/ */
if ((flags & VIR_CGROUP_MEM_HIERACHY) && if ((flags & VIR_CGROUP_MEM_HIERACHY) &&
(group->controllers[VIR_CGROUP_CONTROLLER_MEMORY].mountPoint != NULL) && i == VIR_CGROUP_CONTROLLER_MEMORY &&
(i == VIR_CGROUP_CONTROLLER_MEMORY || group->controllers[i].mountPoint != NULL &&
STREQ(group->controllers[i].mountPoint, virCgroupSetMemoryUseHierarchy(group) < 0) {
group->controllers[VIR_CGROUP_CONTROLLER_MEMORY].mountPoint))) {
if (virCgroupSetMemoryUseHierarchy(group) < 0)
goto error; goto error;
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册