]> git.ipfire.org Git - thirdparty/libvirt.git/commit
qemu: fix domain startup failing with 'strict' mode in numatune
authorWang Rui <moon.wangrui@huawei.com>
Mon, 10 Nov 2014 13:53:19 +0000 (21:53 +0800)
committerMartin Kletzander <mkletzan@redhat.com>
Tue, 11 Nov 2014 11:14:09 +0000 (12:14 +0100)
commitc6e90248676126c209b3b6017ad27cf6c6a0ab8f
treec44e261717ac56a9afd9d146492733e39238842a
parent8a3844f8189af257ff3f5aa298eda55b73f2a4d3
qemu: fix domain startup failing with 'strict' mode in numatune

If the memory mode is specified as 'strict' and with one node, we
get the following error when starting domain.

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

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

It's broken by Commit 411cea638f6ec8503b7142a31e58b1cd85dbeaba
which moved qemuSetupCgroupForEmulator() before setting cpuset.mems
in qemuSetupCgroupPostInit.

Directory '$cgroup_path/emulator/' is created in qemuSetupCgroupForEmulator.
But '$cgroup_path/emulator/cpuset.mems' it not set and has a default value
(all nodes, such as 0-1). Then we setup '$cgroup_path/cpuset.mems' to the
nodemask (in this case it's '0') in qemuSetupCgroupPostInit. It must fail.

This patch makes '$cgroup_path/emulator/cpuset.mems' is set before
'$cgroup_path/cpuset.mems'. The action is similar with that in
qemuDomainSetNumaParamsLive.

Signed-off-by: Wang Rui <moon.wangrui@huawei.com>
src/qemu/qemu_cgroup.c