[libvirt] [PATCH] qemu: don't setup cpuset.mems if memory mode in numatune is 'preferred'

Wang Rui moon.wangrui at huawei.com
Tue Nov 4 13:22:22 UTC 2014


If the memory mode is specified as preferred, we get the following error when
starting domain.

error: Unable to write to '$my_cgroup_path/cpuset.mems': Device or resource busy

XML is configured with numatune as follows:
  <numatune>
    <memory mode='preferred' nodeset='0'/>
  </numatune>

If memory mode is 'preferred', cpuset.mems in cgroup shouldn't be set to
'nodeset'. I find that maybe commit 1a7be8c600905aa07ac2d78293336ba8523ad48e
changes the former logic of checking mode in virDomainNumatuneGetNodeset.

Signed-off-by: Wang Rui <moon.wangrui at huawei.com>
---
 src/qemu/qemu_cgroup.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/qemu/qemu_cgroup.c b/src/qemu/qemu_cgroup.c
index b5bdb36..8685d6f 100644
--- a/src/qemu/qemu_cgroup.c
+++ b/src/qemu/qemu_cgroup.c
@@ -618,6 +618,11 @@ qemuSetupCpusetMems(virDomainObjPtr vm,
     if (!virCgroupHasController(priv->cgroup, VIR_CGROUP_CONTROLLER_CPUSET))
         return 0;
 
+    if (virDomainNumatuneGetMode(vm->def->numatune, -1) !=
+        VIR_DOMAIN_NUMATUNE_MEM_STRICT) {
+        return 0;
+    }
+
     if (virDomainNumatuneMaybeFormatNodeset(vm->def->numatune,
                                             nodemask,
                                             &mem_mask, -1) < 0)
-- 
1.7.12.4




More information about the libvir-list mailing list