From: Luyao Huang Date: Fri, 3 Apr 2015 10:11:15 +0000 (+0800) Subject: lxc: fix starting a domain with a cpuset but no numatune X-Git-Tag: v1.2.13.1~99 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=278995f9af0fd04b282870d4dfd24220ad3e716e;p=thirdparty%2Flibvirt.git 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 Signed-off-by: Ján Tomko (cherry picked from commit 461eafecfade36555e44378c34568caf55c5cc8a) --- diff --git a/src/lxc/lxc_cgroup.c b/src/lxc/lxc_cgroup.c index 8e46a01284..b13fede81d 100644 --- a/src/lxc/lxc_cgroup.c +++ b/src/lxc/lxc_cgroup.c @@ -77,6 +77,8 @@ static int virLXCCgroupSetupCpusetTune(virDomainDefPtr def, if (virCgroupSetCpusetCpus(cgroup, mask) < 0) 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) !=