Signed-off-by: Martin Kletzander <mkletzan(a)redhat.com>
---
src/qemu/qemu_cgroup.c | 29 ++++++++++++++++++++++++-----
1 file changed, 24 insertions(+), 5 deletions(-)
diff --git a/src/qemu/qemu_cgroup.c b/src/qemu/qemu_cgroup.c
index ff268fb..eebe9e9 100644
--- a/src/qemu/qemu_cgroup.c
+++ b/src/qemu/qemu_cgroup.c
@@ -576,13 +576,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))
@@ -597,6 +595,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)) {
@@ -619,7 +639,6 @@ qemuSetupCpusetCgroup(virDomainObjPtr vm,
ret = 0;
cleanup:
- VIR_FREE(mem_mask);
VIR_FREE(cpu_mask);
return ret;
}
--
2.0.0