]> xenbits.xensource.com Git - libvirt.git/commitdiff
lxc: fix starting a domain with a cpuset but no numatune
authorLuyao Huang <lhuang@redhat.com>
Fri, 3 Apr 2015 10:11:15 +0000 (18:11 +0800)
committerJán Tomko <jtomko@redhat.com>
Mon, 20 Apr 2015 13:50:40 +0000 (15:50 +0200)
 # 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>
src/lxc/lxc_cgroup.c

index c1813e21fe646817ab0275a83c3909d1a2cc1ae4..3c4078461dabac77a4fbacd795be876a80139af3 100644 (file)
@@ -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) !=