~ubuntu-branches/ubuntu/karmic/libvirt/karmic-proposed

« back to all changes in this revision

Viewing changes to python/libvir.c

  • Committer: Bazaar Package Importer
  • Author(s): Soren Hansen
  • Date: 2009-02-11 01:01:42 UTC
  • mfrom: (1.1.9 upstream)
  • Revision ID: james.westby@ubuntu.com-20090211010142-8zrm7z1u6ryfhkiq
Tags: 0.6.0-1ubuntu1
* Merge with Debian experimental. Remaining changes:
  - debian/control:
    + Don't build-depend on QEmu.
    + Add "XS-Debian-" prefix to Debian's Vcs headers.
    + Bump bridge-utils, dnsmasq-base, netcat-openbsd, and iptables
      to Depends of libvirt-bin.
    + s/interract/interact/g
    + Add versioned Conflicts/Replaces to libvirt0 for libvirt0-dbg,
      since we used to ship them as such.
  - Rename libvirt group to libvirtd.
  - 0005-delayed_iff_up_bridge.patch: Don't try to bring up the bridge
    before at least one interface has been added to it.
  - dont_clobber_existing_bridges.patch: Assign the name of the virtual
    bridge dynamically to avoid interfering with existing bridges.
  - better_default_uri_virsh.patch: Default to qemu:///system if the
    user has write access to the libvirt socket, otherwise
    qemu:///session.
  - We call libxen-dev libxen3-dev, so change all references.
  - Included (but did not enable) opennebula patch (since it's not in
    main yet).

Show diffs side-by-side

added added

removed removed

Lines of Context:
438
438
static PyObject *
439
439
libvirt_virGetLastError(PyObject *self ATTRIBUTE_UNUSED, PyObject *args ATTRIBUTE_UNUSED)
440
440
{
441
 
    virError err;
 
441
    virError *err;
442
442
    PyObject *info;
443
443
 
444
 
    if (virCopyLastError(&err) <= 0)
 
444
    if ((err = virGetLastError()) == NULL)
445
445
        return VIR_PY_NONE;
446
446
 
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));
458
458
 
459
459
    return info;
460
460
}
462
462
static PyObject *
463
463
libvirt_virConnGetLastError(PyObject *self ATTRIBUTE_UNUSED, PyObject *args)
464
464
{
465
 
    virError err;
 
465
    virError *err;
466
466
    PyObject *info;
467
467
    virConnectPtr conn;
468
468
    PyObject *pyobj_conn;
471
471
        return(NULL);
472
472
    conn = (virConnectPtr) PyvirConnect_Get(pyobj_conn);
473
473
 
474
 
    if (virConnCopyLastError(conn, &err) <= 0)
 
474
    if ((err = virConnGetLastError(conn)) == NULL)
475
475
        return VIR_PY_NONE;
476
476
 
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));
488
488
 
489
489
    return info;
490
490
}