438
438
static PyObject *
439
439
libvirt_virGetLastError(PyObject *self ATTRIBUTE_UNUSED, PyObject *args ATTRIBUTE_UNUSED)
444
if (virCopyLastError(&err) <= 0)
444
if ((err = virGetLastError()) == NULL)
445
445
return VIR_PY_NONE;
447
447
if ((info = PyTuple_New(9)) == NULL)
448
448
return VIR_PY_NONE;
449
PyTuple_SetItem(info, 0, PyInt_FromLong((long) err.code));
450
PyTuple_SetItem(info, 1, PyInt_FromLong((long) err.domain));
451
PyTuple_SetItem(info, 2, libvirt_constcharPtrWrap(err.message));
452
PyTuple_SetItem(info, 3, PyInt_FromLong((long) err.level));
453
PyTuple_SetItem(info, 4, libvirt_constcharPtrWrap(err.str1));
454
PyTuple_SetItem(info, 5, libvirt_constcharPtrWrap(err.str2));
455
PyTuple_SetItem(info, 6, libvirt_constcharPtrWrap(err.str3));
456
PyTuple_SetItem(info, 7, PyInt_FromLong((long) err.int1));
457
PyTuple_SetItem(info, 8, PyInt_FromLong((long) err.int2));
449
PyTuple_SetItem(info, 0, PyInt_FromLong((long) err->code));
450
PyTuple_SetItem(info, 1, PyInt_FromLong((long) err->domain));
451
PyTuple_SetItem(info, 2, libvirt_constcharPtrWrap(err->message));
452
PyTuple_SetItem(info, 3, PyInt_FromLong((long) err->level));
453
PyTuple_SetItem(info, 4, libvirt_constcharPtrWrap(err->str1));
454
PyTuple_SetItem(info, 5, libvirt_constcharPtrWrap(err->str2));
455
PyTuple_SetItem(info, 6, libvirt_constcharPtrWrap(err->str3));
456
PyTuple_SetItem(info, 7, PyInt_FromLong((long) err->int1));
457
PyTuple_SetItem(info, 8, PyInt_FromLong((long) err->int2));
472
472
conn = (virConnectPtr) PyvirConnect_Get(pyobj_conn);
474
if (virConnCopyLastError(conn, &err) <= 0)
474
if ((err = virConnGetLastError(conn)) == NULL)
475
475
return VIR_PY_NONE;
477
477
if ((info = PyTuple_New(9)) == NULL)
478
478
return VIR_PY_NONE;
479
PyTuple_SetItem(info, 0, PyInt_FromLong((long) err.code));
480
PyTuple_SetItem(info, 1, PyInt_FromLong((long) err.domain));
481
PyTuple_SetItem(info, 2, libvirt_constcharPtrWrap(err.message));
482
PyTuple_SetItem(info, 3, PyInt_FromLong((long) err.level));
483
PyTuple_SetItem(info, 4, libvirt_constcharPtrWrap(err.str1));
484
PyTuple_SetItem(info, 5, libvirt_constcharPtrWrap(err.str2));
485
PyTuple_SetItem(info, 6, libvirt_constcharPtrWrap(err.str3));
486
PyTuple_SetItem(info, 7, PyInt_FromLong((long) err.int1));
487
PyTuple_SetItem(info, 8, PyInt_FromLong((long) err.int2));
479
PyTuple_SetItem(info, 0, PyInt_FromLong((long) err->code));
480
PyTuple_SetItem(info, 1, PyInt_FromLong((long) err->domain));
481
PyTuple_SetItem(info, 2, libvirt_constcharPtrWrap(err->message));
482
PyTuple_SetItem(info, 3, PyInt_FromLong((long) err->level));
483
PyTuple_SetItem(info, 4, libvirt_constcharPtrWrap(err->str1));
484
PyTuple_SetItem(info, 5, libvirt_constcharPtrWrap(err->str2));
485
PyTuple_SetItem(info, 6, libvirt_constcharPtrWrap(err->str3));
486
PyTuple_SetItem(info, 7, PyInt_FromLong((long) err->int1));
487
PyTuple_SetItem(info, 8, PyInt_FromLong((long) err->int2));