]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
Return right error code for baselineCPU
authorDon Dugger <n0ano@n0ano.com>
Sat, 23 Nov 2013 21:15:38 +0000 (14:15 -0700)
committerCole Robinson <crobinso@redhat.com>
Sat, 14 Dec 2013 18:39:20 +0000 (13:39 -0500)
This Python interface code is returning a -1 on errors for the
`baselineCPU' API.  Since this API is supposed to return a pointer
the error return value should really be VIR_PY_NONE.

NB:  I've checked all the other APIs in this file and this is the
only pointer API that is returning -1.

Signed-off-by: Don Dugger <donald.d.dugger@intel.com>
(crobinso: Upstream in libvirt-python.git)

python/libvirt-override.c

index ad5f578cbc3d757b52ec60522d9776b0ae539b32..ab9fbd0656b82c6fbc9181a40e1b47f0606e3845 100644 (file)
@@ -4235,12 +4235,13 @@ libvirt_virConnectBaselineCPU(PyObject *self ATTRIBUTE_UNUSED,
         ncpus = PyList_Size(list);
         if (VIR_ALLOC_N(xmlcpus, ncpus) < 0)
             return VIR_PY_INT_FAIL;
+            return VIR_PY_NONE;
 
         for (i = 0; i < ncpus; i++) {
             xmlcpus[i] = PyString_AsString(PyList_GetItem(list, i));
             if (xmlcpus[i] == NULL) {
                 VIR_FREE(xmlcpus);
-                return VIR_PY_INT_FAIL;
+                return VIR_PY_NONE;
             }
         }
     }
@@ -4252,13 +4253,13 @@ libvirt_virConnectBaselineCPU(PyObject *self ATTRIBUTE_UNUSED,
     VIR_FREE(xmlcpus);
 
     if (base_cpu == NULL)
-        return VIR_PY_INT_FAIL;
+        return VIR_PY_NONE;
 
     pybase_cpu = PyString_FromString(base_cpu);
     VIR_FREE(base_cpu);
 
     if (pybase_cpu == NULL)
-        return VIR_PY_INT_FAIL;
+        return VIR_PY_NONE;
 
     return pybase_cpu;
 }