mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-23 13:05:27 +00:00
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> (cherry picked from commit c6e90248676126c209b3b6017ad27cf6c6a0ab8f)
This commit is contained in:
parent
ca1701e3c2
commit
e22677268c
@ -611,6 +611,7 @@ static int
|
||||
qemuSetupCpusetMems(virDomainObjPtr vm,
|
||||
virBitmapPtr nodemask)
|
||||
{
|
||||
virCgroupPtr cgroup_temp = NULL;
|
||||
qemuDomainObjPrivatePtr priv = vm->privateData;
|
||||
char *mem_mask = NULL;
|
||||
int ret = -1;
|
||||
@ -623,13 +624,16 @@ qemuSetupCpusetMems(virDomainObjPtr vm,
|
||||
&mem_mask, -1) < 0)
|
||||
goto cleanup;
|
||||
|
||||
if (mem_mask &&
|
||||
virCgroupSetCpusetMems(priv->cgroup, mem_mask) < 0)
|
||||
goto cleanup;
|
||||
if (mem_mask)
|
||||
if (virCgroupNewEmulator(priv->cgroup, false, &cgroup_temp) < 0 ||
|
||||
virCgroupSetCpusetMems(cgroup_temp, mem_mask) < 0 ||
|
||||
virCgroupSetCpusetMems(priv->cgroup, mem_mask) < 0)
|
||||
goto cleanup;
|
||||
|
||||
ret = 0;
|
||||
cleanup:
|
||||
VIR_FREE(mem_mask);
|
||||
virCgroupFree(&cgroup_temp);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user