libvirt/python
Eric Blake 7b4e5693c1 API: make declaration of _LAST enum values conditional
Although this is a public API break, it only affects users that
were compiling against *_LAST values, and can be trivially
worked around without impacting compilation against older
headers, by the user defining VIR_ENUM_SENTINELS before using
libvirt.h.  It is not an ABI break, since enum values do not
appear as .so entry points.  Meanwhile, it prevents users from
using non-stable enum values without explicitly acknowledging
the risk of doing so.

See this list discussion:
https://www.redhat.com/archives/libvir-list/2012-January/msg00804.html

* include/libvirt/libvirt.h.in: Hide all sentinels behind
LIBVIRT_ENUM_SENTINELS, and add missing sentinels.
* src/internal.h (VIR_DEPRECATED): Allow inclusion after
libvirt.h.
(LIBVIRT_ENUM_SENTINELS): Expose sentinels internally.
* daemon/libvirtd.h: Use the sentinels.
* src/remote/remote_protocol.x (includes): Don't expose sentinels.
* python/generator.py (enum): Likewise.
* tests/cputest.c (cpuTestCompResStr): Silence compiler warning.
* tools/virsh.c (vshDomainStateReasonToString)
(vshDomainControlStateToString): Likewise.
2012-01-20 16:05:51 -07:00
..
tests maint: add missing copyright notices 2011-07-28 15:01:17 -06:00
.gitignore Re-arrange python generator to make it clear what's auto-generated 2009-09-21 14:41:46 +01:00
generator.py API: make declaration of _LAST enum values conditional 2012-01-20 16:05:51 -07:00
libvirt-override-api.xml python: Fix problems of virDomain{Set, Get}BlockIoTune bindings 2011-12-29 14:07:47 +08:00
libvirt-override-virConnect.py startupPolicy: Emit event on disk source dropping 2011-10-25 09:27:10 +02:00
libvirt-override-virStream.py python: Fix documentation of virStream recv 2011-10-31 18:07:05 +01:00
libvirt-override.c remove a static limit on max domains in python bindings 2011-12-29 16:20:00 +08:00
libvirt-override.py Fix two comments related to error handling 2011-10-17 17:21:56 +02:00
libvirt-qemu-override-api.xml qemu_api: Add override XML and C files for QEMU APIs 2011-09-14 11:38:51 +08:00
libvirt-qemu-override.c qemu_api: Add override XML and C files for QEMU APIs 2011-09-14 11:38:51 +08:00
Makefile.am qemu_api: Update Makefile to generate libvirtmod_qemu lib 2011-09-14 11:38:59 +08:00
README Re-arrange python generator to make it clear what's auto-generated 2009-09-21 14:41:46 +01:00
TODO
typewrappers.c python: Implement virStreamSend/Recv 2011-06-21 10:08:47 -04:00
typewrappers.h python: Don't declare Py_ssize_t for Python 2.6 2011-06-24 19:34:56 +02:00

    libvirt Python Bindings README
    ==============================

Most of the libvirt python binding code is automatically generated
using the script  generator.py, and the API description from
docs/libvirt-api.xml


Manually written files:

 - libvirt-override.c: methods where the C binding needs to be hand crafted
 - libvirt-override.py: global methods where the C and python bindings have different args
 - libvirt-override-api.xml: methods where the auto-extracted API docs are not
   suitable for python auto-generator. Overriding this if the method is going
   into libvirt-override.c, but we still want auto-generated libvirt-override.py
 - libvirt-override-virConnect.py: virConnect class methods
 - typewrappers.h,.c: Python object wrappers for each libvirt C object


Auto-generated files:

  - libvirt.py: The main python binding. Comprises auto-generated code, along
    with contents from libvirt-override.py and libvirt-override-virConnect.py
  - libvirt.c, libvirt.h: The C glue layer for the python binding. Comprises
    auto-generated code, along with libvirt-override.c
  - libvirt-export.c: List of auto-generated C methods, included into
    the libvirt-override.c method table