Commit Graph

10 Commits

Author SHA1 Message Date
Philipp Hahn
0a71c79a34 Fix two comments related to error handling
Signed-off-by: Philipp Hahn <hahn@univention.de>
2011-10-17 17:21:56 +02:00
Eric Blake
dbbe16c26e maint: typo fixes
I noticed a couple typos in recent commits, and fixed the remaining
instances of them.

* docs/internals/command.html.in: Fix spelling errors.
* include/libvirt/libvirt.h.in (virConnectDomainEventCallback):
Likewise.
* python/libvirt-override.py (virEventAddHandle): Likewise.
* src/lxc/lxc_container.c (lxcContainerChild): Likewise.
* src/util/hash.c (virHashCreateFull): Likewise.
* src/storage/storage_backend_logical.c
(virStorageBackendLogicalMakeVol): Likewise.
* src/esx/esx_driver.c (esxFormatVMXFileName): Likewise.
* src/vbox/vbox_tmpl.c (vboxIIDIsEqual_v3_x): Likewise.
2011-10-10 14:02:06 -06:00
Cole Robinson
7268cb9274 python: Mark event callback wrappers as private
These functions aren't intended to be called directly by users, so mark
them as private.

While we're at it, remove unneeded exception handling, and break some
long lines.
2011-06-21 10:08:48 -04:00
Cole Robinson
f2fb235b1d python: events: Fix C->Python handle callback prototype
If registering our own event loop implementation written in python,
any handles or timeouts callbacks registered by libvirt C code must
be wrapped in a python function. There is some argument trickery that
makes this all work, by wrapping the user passed opaque value in
a tuple, along with the callback function.

Problem is, the current setup requires the user's event loop to know
about this trickery, rather than just treating the opaque value
as truly opaque.

Fix this in a backwards compatible manner, and adjust the example
python event loop to do things the proper way.
2011-06-21 10:08:48 -04:00
Cole Robinson
d0e3f3d6a6 python: Add bindings for virEvent*Handle/Timeout 2011-06-21 10:08:47 -04:00
Jiri Denemark
c51f08272a python: Use hardcoded python path in libvirt.py
This partially reverts (and fixes that part in a different way) commit
e4384459c9, which replaced
``/usr/bin/python'' with ``/usr/bin/env python'' in all examples or
scripts used during build to generate other files.

However, python bindings module is compiled and linked against a
specific python discovered or explicitly provided in configure phase.
Thus libvirt.py, which is generated and installed into the system,
should use the same python binary for which the module has been built.

The hunk in Makefile.am replaces $(srcdir) with $(PYTHON), which might
seem wrong but it is not. generator.py didn't use any of its command
line arguments so passing $(srcdir) to it was redundant.
2011-03-14 12:37:19 +01:00
Matthias Bolte
e4384459c9 Use python discovered through env instead of hardcoding a path
This is more flexible regarding the location of the python binary
but doesn't allow to pass the -u flag. The -i flag can be passed
from inside the script using the PYTHONINSPECT env variable.

This fixes a problem with the esx_vi_generator.py on FreeBSD.
2010-11-14 22:45:59 +01:00
Dan Kenigsberg
fe3bb9440a python: drop unnecessary conn assignment
Since 554d82a200, conn is unused. Let's
drop it - but keep the signature of the constructor for backward
compatibility.
2010-09-27 15:10:38 -06:00
Daniel P. Berrange
7ad5c00ed9 Misc syntax-check fixes 2009-09-21 14:41:47 +01:00
Daniel P. Berrange
f991a00653 Re-arrange python generator to make it clear what's auto-generated
* README: New file describing what each file is used for
* livvirt-override.c, libvirt-override.py, libvirt-override-api.xml,
  libvirt-override-virConnect.py: Manually written code overriding
  the generator
* typewrappers.c, typewrappers.h: Data type wrappers
* generator.py: Automatically pre-prend contents of libvirt-override.py
  to generated libvirt.py. Output into libvirt.py directly instead of
  libvirtclass.py. Don't generate libvirtclass.txt at all. Write C
  files into libvirt.c/.h directly
* Makefile.am: Remove rule for creating libvirt.py from libvirt-override.py
  and libvirtclass.py, since generator.py does it directly
2009-09-21 14:41:46 +01:00