lxc: fix starting a domain with a cpuset but no numatune

# virsh -c lxc:/// start helloworld
 error: Failed to start domain helloworld
 error: internal error: guest failed to start: Invalid value '1-3'
 for 'cpuset.mems': Invalid argument

Free the cpu mask to avoid reusing it as a mem mask
in virCgroupSetCpusetMems
if virDomainNumatuneMaybeFormatNodeset does not set a mask.

Signed-off-by: Luyao Huang <lhuang@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
Luyao Huang 2015-04-03 18:11:15 +08:00 committed by Ján Tomko
parent 749ebfd8f8
commit 461eafecfa

View File

@ -77,6 +77,8 @@ static int virLXCCgroupSetupCpusetTune(virDomainDefPtr def,
if (virCgroupSetCpusetCpus(cgroup, mask) < 0) if (virCgroupSetCpusetCpus(cgroup, mask) < 0)
goto cleanup; goto cleanup;
/* free mask to make sure we won't use it in a wrong way later */
VIR_FREE(mask);
} }
if (virDomainNumatuneGetMode(def->numa, -1) != if (virDomainNumatuneGetMode(def->numa, -1) !=