]> xenbits.xensource.com Git - libvirt.git/commitdiff
nodeinfo: report error when failure in nodeSetMemoryParameters
authorJincheng Miao <jmiao@redhat.com>
Fri, 7 Nov 2014 10:27:00 +0000 (11:27 +0100)
committerPavel Hrdina <phrdina@redhat.com>
Mon, 10 Nov 2014 14:06:57 +0000 (15:06 +0100)
nodeSetMemoryParameters() will call nodeSetMemoryParameterValue()
to set parameters. But it just filter the return code '-2' as
failure. Indeed we should report error when rc is negative.

https://bugzilla.redhat.com/show_bug.cgi?id=1161541

Signed-off-by: Jincheng Miao <jmiao@redhat.com>
src/nodeinfo.c

index 2e2fffac1155eac8a78aef5ce8d357c3f77d3df0..3c22ebc584e2e1925d0b8c79bcb9878b34a722a2 100644 (file)
@@ -1374,8 +1374,7 @@ nodeSetMemoryParameters(virTypedParameterPtr params ATTRIBUTE_UNUSED,
     for (i = 0; i < nparams; i++) {
         rc = nodeSetMemoryParameterValue(&params[i]);
 
-        /* Out of memory */
-        if (rc == -2)
+        if (rc < 0)
             return -1;
     }