]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: Add missing goto error in qemuRestoreCgroupState
authorMartin Kletzander <mkletzan@redhat.com>
Tue, 16 Dec 2014 18:59:33 +0000 (19:59 +0100)
committerMartin Kletzander <mkletzan@redhat.com>
Tue, 16 Dec 2014 19:44:33 +0000 (20:44 +0100)
Commit af2a1f05 tried clearly separating each condition in
qemuRestoreCgroupState() for the sake of readability, however somehow
one condition body was missing.  That means that the body of the next
condition got executed only if both of there were true, which is
impossible, thus resulting in a dead code and a logic error.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
src/qemu/qemu_cgroup.c

index 1e383c438274e41c02fdb4869c544a6dbfb7f18d..1acb77d253e3ed6fc6332bc2071253becbebc172 100644 (file)
@@ -800,9 +800,7 @@ qemuRestoreCgroupState(virDomainObjPtr vm)
         goto error;
 
     if ((empty = virCgroupHasEmptyTasks(priv->cgroup,
-                                        VIR_CGROUP_CONTROLLER_CPUSET)) < 0)
-
-    if (!empty)
+                                        VIR_CGROUP_CONTROLLER_CPUSET)) <= 0)
         goto error;
 
     if (virCgroupSetCpusetMems(priv->cgroup, mem_mask) < 0)