1
0
mirror of https://gitlab.com/libvirt/libvirt-python.git synced 2025-07-18 04:59:33 +03:00

Return right error code for baselineCPU

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.

Signed-off-by: Don Dugger <donald.d.dugger@intel.com>
This commit is contained in:
Don Dugger
2013-11-26 16:53:20 +00:00
committed by Daniel P. Berrange
parent e81d4dce75
commit 8dd64f07ea

View File

@ -4496,13 +4496,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;
}
}
}
@ -4514,13 +4514,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;
}