libvirt/python
Eric Blake f73198df3b python: avoid unlikely sign extension bug
Detected by Coverity.  cpumap was allocated with a value of
(unsigned short)*(int), which is an int computation, and then
promotes to size_t.  On a 64-bit platform, this fails if bit
32 of the product is set (because of sign extension giving
a HUGE value to malloc), even though a naive programmer would
assume that since the first value is unsigned, the product
is also unsigned and at most 4GB would be allocated.

Won't bite in practice (the product should never be that large),
but worth using the right types to begin with, so that we are
now computing (unsigned short)*(size_t).

* python/libvirt-override.c (libvirt_virDomainGetVcpus): Use
correct type.
2011-06-08 05:28:20 -06:00
..
tests maint: fix grammar in error message 2011-02-21 10:35:25 -07:00
.gitignore Re-arrange python generator to make it clear what's auto-generated 2009-09-21 14:41:46 +01:00
generator.py sched: introduce virDomainGetSchedulerParametersFlags 2011-05-29 18:38:10 +08:00
libvirt-override-api.xml virDomainGetState public API 2011-05-16 10:04:18 +02:00
libvirt-override-virConnect.py Fix SEGV on exit after domainEventDeregister() 2010-07-23 13:26:40 -06:00
libvirt-override-virStream.py Add public API definition for data stream handling 2009-09-29 15:48:52 +01:00
libvirt-override.c python: avoid unlikely sign extension bug 2011-06-08 05:28:20 -06:00
libvirt-override.py python: Use hardcoded python path in libvirt.py 2011-03-14 12:37:19 +01:00
Makefile.am python: Use hardcoded python path in libvirt.py 2011-03-14 12:37:19 +01:00
README Re-arrange python generator to make it clear what's auto-generated 2009-09-21 14:41:46 +01:00
TODO syntax-check: enforce the no-cvs-keywords prohibition 2008-12-15 10:24:54 +00:00
typewrappers.c python: Use PyCapsule API if available 2011-01-10 15:18:05 -05:00
typewrappers.h nwfilter: python bindings for nwfilter 2010-04-29 06:46:01 -04: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