提交 aa668fcc 编写于 作者: M Martin Kletzander

qemu: split out cpuset.mems setting

Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
上级 1c19d3e0
......@@ -589,13 +589,11 @@ qemuSetupDevicesCgroup(virQEMUDriverPtr driver,
static int
qemuSetupCpusetCgroup(virDomainObjPtr vm,
virBitmapPtr nodemask,
virCapsPtr caps)
qemuSetupCpusetMems(virDomainObjPtr vm,
virBitmapPtr nodemask)
{
qemuDomainObjPrivatePtr priv = vm->privateData;
char *mem_mask = NULL;
char *cpu_mask = NULL;
int ret = -1;
if (!virCgroupHasController(priv->cgroup, VIR_CGROUP_CONTROLLER_CPUSET))
......@@ -610,6 +608,28 @@ qemuSetupCpusetCgroup(virDomainObjPtr vm,
virCgroupSetCpusetMems(priv->cgroup, mem_mask) < 0)
goto cleanup;
ret = 0;
cleanup:
VIR_FREE(mem_mask);
return ret;
}
static int
qemuSetupCpusetCgroup(virDomainObjPtr vm,
virBitmapPtr nodemask,
virCapsPtr caps)
{
qemuDomainObjPrivatePtr priv = vm->privateData;
char *cpu_mask = NULL;
int ret = -1;
if (!virCgroupHasController(priv->cgroup, VIR_CGROUP_CONTROLLER_CPUSET))
return 0;
if (qemuSetupCpusetMems(vm, nodemask) < 0)
goto cleanup;
if (vm->def->cpumask ||
(vm->def->placement_mode == VIR_DOMAIN_CPU_PLACEMENT_MODE_AUTO)) {
......@@ -632,7 +652,6 @@ qemuSetupCpusetCgroup(virDomainObjPtr vm,
ret = 0;
cleanup:
VIR_FREE(mem_mask);
VIR_FREE(cpu_mask);
return ret;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册