summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* python: Actually implement list*Interfaces bindingsv0.7.4v0.7.3Cole Robinson2009-11-203-2/+114
| | | | | | * python/generator.py python/libvirt-override-api.xml python/libvirt-override.c: implement the bindings for virConnectListInterfaces() and virConnectListDefinedInterfaces()
* Add virConnectGetLibvirtVersion APICole Robinson2009-11-123-0/+32
| | | | | | There is currently no way to determine the libvirt version of a remote libvirtd we are connected to. This is a useful piece of data to enable feature detection.
* give up python interpreter lock before calling cbDan Kenigsberg2009-11-031-2/+8
| | | | | | | | suggested by danpb on irc, patch by danken fixed for proper C syntax * python/libvirt-override.c: on event callback release the python interpreter lock and take it again when coming back so that the callback can reinvoke libvirt.
* python: Add a newline after custom classesv0.7.2Cole Robinson2009-10-051-0/+1
| | | | | In the generated bindings, custom classes are squashed against the following class, which hurts readability.
* python: Fix generated virInterface method namesCole Robinson2009-10-051-2/+5
| | | | | | | | | | | A mistake in the generator was causing virInterface methods to be generated with unpredicatable names ('ceUndefine', instead of just 'undefine'). This fixes the method names to match existing convention. Does anyone care if we are breaking API compat? My guess is that no one is using the python interface bindings yet. Signed-off-by: Cole Robinson <crobinso@redhat.com>
* python: Use a pure python implementation of 'vir*GetConnect'Cole Robinson2009-10-051-0/+21
| | | | | | | | The API docs explictly warn that we shouldn't use the C vir*GetConnect calls in bindings: doing so can close the internal connection pointer and cause things to get screwy. Implement these calls in python. Signed-off-by: Cole Robinson <crobinso@redhat.com>
* python: Don't generate bindings for vir*RefCole Robinson2009-10-051-0/+10
| | | | | | | They are only for use in implementing the bindings, so shouldn't be exposed to regular API users. Signed-off-by: Cole Robinson <crobinso@redhat.com>
* python: Don't generate conflicting conn.createXML functions.Cole Robinson2009-10-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A special case in the generator wasn't doing its job, and duplicate conn.createXML functions were being generated. The bindings diff is: @@ -1079,14 +1079,6 @@ class virConnect: return __tmp def createXML(self, xmlDesc, flags): - """Create a new device on the VM host machine, for example, - virtual HBAs created using vport_create. """ - ret = libvirtmod.virNodeDeviceCreateXML(self._o, xmlDesc, flags) - if ret is None:raise libvirtError('virNodeDeviceCreateXML() failed', conn=self) - __tmp = virNodeDevice(self, _obj=ret) - return __tmp - - def createXML(self, xmlDesc, flags): """Launch a new guest domain, based on an XML description similar to the one returned by virDomainGetXMLDesc() This function may requires privileged access to the hypervisor. @@ -1327,6 +1319,14 @@ class virConnect: __tmp = virNetwork(self, _obj=ret) return __tmp + def nodeDeviceCreateXML(self, xmlDesc, flags): + """Create a new device on the VM host machine, for example, + virtual HBAs created using vport_create. """ + ret = libvirtmod.virNodeDeviceCreateXML(self._o, xmlDesc, flags) + if ret is None:raise libvirtError('virNodeDeviceCreateXML() failed', conn=self) + __tmp = virNodeDevice(self, _obj=ret) + return __tmp + def nodeDeviceLookupByName(self, name): """Lookup a node device by its name. """ ret = libvirtmod.virNodeDeviceLookupByName(self._o, name) Signed-off-by: Cole Robinson <crobinso@redhat.com>
* python: Remove use of xmllib in generator.pyCole Robinson2009-10-051-14/+9
| | | | | | | xmllib has been deprecated since python 2.0, and running the generator throws a warning. Move to using xml.sax Signed-off-by: Cole Robinson <crobinso@redhat.com>
* python: Remove FastParser from generator.Cole Robinson2009-10-051-50/+3
| | | | | | | | | FastParser uses sgmlop, a non-standard python module meant as a replacement for xmllib (which is deprecated since python 2.0). Fedora doesn't even carry this module, and the generator doesn't have high performance requirements, so just rip the code out. Signed-off-by: Cole Robinson <crobinso@redhat.com>
* Add public API definition for data stream handlingDaniel P. Berrange2009-09-295-5/+74
| | | | | | | | | | | | | | | | | | | * include/libvirt/libvirt.h.in: Public API contract for virStreamPtr object * src/libvirt_public.syms: Export data stream APIs * src/libvirt_private.syms: Export internal helper APIs * src/libvirt.c: Data stream API driver dispatch * src/datatypes.h, src/datatypes.c: Internal helpers for virStreamPtr object * src/driver.h: Define internal driver API for streams * .x-sc_avoid_write: Ignore src/libvirt.c because it trips up on comments including write() * python/Makefile.am: Add libvirt-override-virStream.py * python/generator.py: Add rules for virStreamPtr class * python/typewrappers.h, python/typewrappers.c: Wrapper for virStreamPtr * docs/libvirt-api.xml, docs/libvirt-refs.xml: Regenerate with new APIs
* Fix API doc extractor to stop munging comment formattingDaniel P. Berrange2009-09-281-12/+13
| | | | | | | | | | | | | | | | | | | | | The python method help docs are copied across from the C funtion comments, but in the process all line breaks and indentation was being lost. This made the resulting text and code examples completely unreadable. Both the API doc extractor and the python generator were destroying whitespace & this fixes them to preserve it exactly. * docs/apibuild.py: Preserve all whitespace when extracting function comments. Print function comment inside a <![CDATA[ section to fully preserve all whitespace. Look for the word 'returns' to describe return values, instead of 'return' to avoid getting confused with code examples including the C 'return' statement. * python/generator.py: Preserve all whitespace when printing function help docs * src/libvirt.c: Change any return parameter indicated by 'return' to be 'returns', to avoid confusing the API extractor * docs/libvirt-api.xml: Re-build for fixed descriptions
* Misc syntax-check fixesDaniel P. Berrange2009-09-211-2/+0
|
* Re-arrange python generator to make it clear what's auto-generatedDaniel P. Berrange2009-09-2110-71/+80
| | | | | | | | | | | | | | * 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
* Add usage type/id as a public API property of virSecretv0.7.1Daniel P. Berrange2009-09-141-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | * include/libvirt/libvirt.h, include/libvirt/libvirt.h.in: Add virSecretGetUsageType, virSecretGetUsageID and virLookupSecretByUsage * python/generator.py: Mark virSecretGetUsageType, virSecretGetUsageID as not throwing exceptions * qemud/remote.c: Implement dispatch for virLookupSecretByUsage * qemud/remote_protocol.x: Add usage type & ID as attributes of remote_nonnull_secret. Add RPC calls for new public APIs * qemud/remote_dispatch_args.h, qemud/remote_dispatch_prototypes.h, qemud/remote_dispatch_ret.h, qemud/remote_dispatch_table.h, qemud/remote_protocol.c, qemud/remote_protocol.h: Re-generate * src/datatypes.c, src/datatypes.h: Add usageType and usageID as properties of virSecretPtr * src/driver.h: Add virLookupSecretByUsage driver entry point * src/libvirt.c: Implement virSecretGetUsageType, virSecretGetUsageID and virLookupSecretByUsage * src/libvirt_public.syms: Export virSecretGetUsageType, virSecretGetUsageID and virLookupSecretByUsage * src/remote_internal.c: Implement virLookupSecretByUsage entry * src/secret_conf.c, src/secret_conf.h: Remove the virSecretUsageType enum, now in public API. Make volume path mandatory when parsing XML * src/secret_driver.c: Enforce usage uniqueness when defining secrets. Implement virSecretLookupByUsage api method * src/virsh.c: Include usage for secret-list command
* Fix UUID handling in secrets/storage encryption APIsDaniel P. Berrange2009-09-143-0/+98
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Convert all the secret/storage encryption APIs / wire format to handle UUIDs in raw format instead of non-canonical printable format. Guarentees data format correctness. * docs/schemas/storageencryption.rng: Make UUID mandatory for a secret and validate fully * docs/schemas/secret.rng: Fully validate UUID * include/libvirt/libvirt.h, include/libvirt/libvirt.h.in, Add virSecretLookupByUUID and virSecretGetUUID. Make virSecretGetUUIDString follow normal API design pattern * python/generator.py: Skip generation of virSecretGetUUID, virSecretGetUUIDString and virSecretLookupByUUID * python/libvir.c, python/libvirt-python-api.xml: Manual impl of virSecretGetUUID,virSecretGetUUIDString and virSecretLookupByUUID * qemud/remote.c: s/virSecretLookupByUUIDString/virSecretLookupByUUID/ Fix get_nonnull_secret/make_nonnull_secret to use unsigned char * qemud/remote_protocol.x: Fix remote_nonnull_secret to use a remote_uuid instead of remote_nonnull_string for UUID field. Rename REMOTE_PROC_SECRET_LOOKUP_BY_UUID_STRING to REMOTE_PROC_SECRET_LOOKUP_BY_UUID_STRING and make it take an remote_uuid value * qemud/remote_dispatch_args.h, qemud/remote_dispatch_prototypes.h, qemud/remote_dispatch_ret.h, qemud/remote_dispatch_table.h, qemud/remote_protocol.c, qemud/remote_protocol.h: Re-generate * src/datatypes.h, src/datatypes.c: Store UUID in raw format instead of printable. Change virGetSecret to use raw format UUID * src/driver.h: Rename virDrvSecretLookupByUUIDString to virDrvSecretLookupByUUID and use raw format UUID * src/libvirt.c: Add virSecretLookupByUUID and virSecretGetUUID and re-implement virSecretLookupByUUIDString and virSecretGetUUIDString in terms of those * src/libvirt_public.syms: Add virSecretLookupByUUID and virSecretGetUUID * src/remote_internal.c: Rename remoteSecretLookupByUUIDString to remoteSecretLookupByUUID. Fix typo in args for remoteSecretDefineXML impl. Use raw UUID format for get_nonnull_secret and make_nonnull_secret * src/storage_encryption_conf.c, src/storage_encryption_conf.h: Storage UUID in raw format, and require it to be present in XML. Use UUID parser to validate. * secret_conf.h, secret_conf.c: Generate a UUID if none is provided. Storage UUID in raw format. * src/secret_driver.c: Adjust to deal with raw UUIDs. Save secrets in a filed with printable UUID, instead of base64 UUID. * src/virsh.c: Adjust for changed public API contract of virSecretGetUUIDString. * src/storage_Backend.c: DOn't undefine secret we just generated upon successful volume creation. Fix to handle raw UUIDs. Generate a non-clashing UUID * src/qemu_driver.c: Change to use lookupByUUID instead of lookupByUUIDString
* python: let libvirt_virConnectDomainEventCallback indicate successJim Meyering2009-09-031-2/+2
| | | | | | | | * python/libvir.c (libvirt_virConnectDomainEventCallback): Return 0 when successful, rather than always returning -1. clang flagged this function for its dead-store of "ret=0". Once "ret" was set to 0, it was never used, and the function would always return -1.
* Secret manipulation API docs refresh & wire up python generatorMiloslav Trmač2009-09-015-4/+167
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Sample session: >>> import libvirt >>> c = libvirt.open('qemu:///session') >>> c.listSecrets() ['12247729-47d2-a783-88ce-b329d4781cd3', 'reee', 'abc'] >>> s = c.secretDefineXML("<secret ephemeral='no' private='no'>\n<description>Something for use</description>\n<volume>/foo/bar</volume>\n</secret>\n") >>> s.UUIDString() '340c2dfb-811b-eda8-da9e-25ccd7bfd650' >>> s.XMLDesc() "<secret ephemeral='no' private='no'>\n <uuid>340c2dfb-811b-eda8-da9e-25ccd7bfd650</uuid>\n <description>Something for use</description>\n <volume>/foo/bar</volume>\n</secret>\n" >>> s.setValue('abc\0xx\xffx') 0 >>> s.value() 'abc\x00xx\xffx' >>> s.undefine() 0 * python/generator.py: Add rules for virSecret APIs * python/libvir.c, python/libvirt-python-api.xml: Manual impl of virSecretSetValue, virSecretGetValue$ and virConnectListSecrets APIs * python/libvirt_wrap.h, python/types.c: Wrapper for virSecret objects * docs/libvirt-api.xml, docs/libvirt-refs.xml, docs/html/libvirt-virterror.html, docs/html/libvirt-libvirt.html, docs/devhelp/libvirt-virterror.html, docs/devhelp/libvirt-libvirt.html: Re-generate with 'make api'
* python: Raise exceptions if virDomain*Stats fail.v0.7.0Cole Robinson2009-07-261-1/+4
| | | | | The generator couldn't tell that the stats return values were pointers. Stick a white list in the function which tries to make this distinction.
* remove all trailing blank linesJim Meyering2009-07-161-1/+0
| | | | | | | by running this command: git ls-files -z | xargs -0 perl -pi -0777 -e 's/\n\n+$/\n/' This is in preparation for a more strict make syntax-check rule that will detect trailing blank lines.
* remove all .cvsignore filesJim Meyering2009-07-082-17/+0
|
* Fix python examples to use read-write connDan Kenigsberg2009-07-061-1/+1
| | | | | | * docs/examples/python/domstart.py python/tests/create.py: The two example were broken as they needed full-access connection but only opened read-only connections
* Fix python domain events example & bindingv0.6.5v0.6.4Daniel P. Berrange2009-05-281-0/+1
|
* Add virInterface APIs to python code generatorDaniel P. Berrange2009-05-213-3/+67
|
* Better error reporting if 'import libvirtmod' failsCole Robinson2009-05-191-2/+6
| | | | | Don't squash a possibly legitimate libvirtmod error (e.g. some from clashing libvirt.so versions) with 'Cannot import cygvirtmod'
* Fix crash after calling virConnectClosev0.6.3v0.6.2Daniel P. Berrange2009-04-011-0/+3
|
* Fix generation of networkCreateXML and storagePoolCreateXMLDaniel P. Berrange2009-04-011-0/+6
|
* update .gitignore and .hgignore filesv0.6.1Jim Meyering2009-03-031-0/+1
|
* Internal driver API for sVirt support (James Morris & Dan Walsh)Daniel P. Berrange2009-03-031-0/+2
|
* Ignore some generated autotools files in example appDaniel P. Berrange2009-03-021-0/+1
|
* * python/Makefile.am: avoid a parallel make issue #472702Daniel Veillard2009-02-261-2/+5
| | | | | provided by Michael Marineau Daniel
* Fix building python bindings: Skip bindings for virSaveLastError andCole Robinson2009-02-161-0/+2
| | | | virFreeError
* Use global thread-local error for all python error reportingv0.6.0Daniel P. Berrange2009-01-202-26/+25
|
* Replace __FUNCTION__ with __func__ for better portability (John Levon)Daniel P. Berrange2008-12-181-2/+2
|
* Fix gcc-ism in python build (John Levon)Daniel P. Berrange2008-12-181-2/+3
|
* syntax-check: enforce the no-cvs-keywords prohibitionJim Meyering2008-12-151-2/+0
| | | | | | | | * Makefile.maint (sc_prohibit_cvs_keyword): New rule. Suggested by Daniel Veillard. The new test exposed two uses of $Date$. * docs/Goals: Don't use $Date$. * python/TODO: Likewise.
* Support domain lifecycle events for Xen (Ben Guthro & Daniel Berrange)v0.5.1v0.5.0Daniel P. Berrange2008-11-251-1/+2
|
* Fix python bindings events code (David Lively)Daniel P. Berrange2008-11-245-42/+178
|
* Python binding for node device APIs (David Lively)Daniel P. Berrange2008-11-215-3/+149
|
* Add a virFreeCallback to event loop APIsDaniel P. Berrange2008-11-193-6/+34
|
* Change public API for virEventAddHandle to allow multiple registrations per FDDaniel P. Berrange2008-11-191-4/+4
|
* Add a virFreeCallback to virDomainEventRegister (from David Lively)Daniel P. Berrange2008-11-191-1/+1
|
* Add domain events detail informationDaniel P. Berrange2008-11-171-2/+4
|
* Fix domain events python thread safety & incorrect enum generationDaniel P. Berrange2008-11-171-14/+93
|
* * python/virConnect.py: needed for events from the python bindingsDaniel Veillard2008-10-311-0/+43
| | | | | by Ben Guthro daniel
* * python/Makefile.am python/generator.py python/libvir.cDaniel Veillard2008-10-316-6/+553
| | | | | | | | | | python/libvir.py python/libvirt_wrap.h python/types.c: adds support for events from the python bindings, also improves the generator allowing to embbed per function definition files, patch by Ben Guthro * examples/domain-events/events-python/event-test.py: also adds a programming example Daniel
* Massive patch adding event APIs by Ben GuthroDaniel Veillard2008-10-231-0/+3
| | | | | | | | | | | | | | | | | | | | | | * include/libvirt/libvirt.h include/libvirt/libvirt.h.in src/libvirt.c src/libvirt_sym.version: new libvirt event entry points, big patch provided by Ben Guthro * Makefile.am configure.in src/driver.h src/event.c src/event.h src/internal.h src/libvirt.c src/libvirt_sym.version src/lxc_driver.c src/openvz_driver.c src/qemu_conf.h src/qemu_driver.c src/remote_internal.c src/storage_backend_fs.c src/test.c qemud/event.c qemud/event.h qemud/mdns.c qemud/qemud.c qemud/qemud.h qemud/remote.c qemud/remote_dispatch_localvars.h qemud/remote_dispatch_proc_switch.h qemud/remote_dispatch_prototypes.h qemud/remote_protocol.c qemud/remote_protocol.h qemud/remote_protocol.x proxy/Makefile.am python/generator.py: Not much is left untouched by the patch adding the events support * docs/libvirt-api.xml docs/libvirt-refs.xml docs/html/libvirt-libvirt.html: regenerated the docs * examples/domain-events/events-c/Makefile.am examples/domain-events/events-c/event-test.c: a test example * AUTHORS: added Ben Guthro daniel
* generate .gitignore files from .cvsignore onesJim Meyering2008-10-172-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Makefile.maint (sync-vcs-ignore-files): New target. Prompted by a patch from James Morris. http://thread.gmane.org/gmane.comp.emulators.libvirt/8619/focus=8773 Add all (now-generated) .gitignore files. * .gitignore: New file. * build-aux/.gitignore: New file. * docs/.gitignore: New file. * docs/devhelp/.gitignore: New file. * docs/examples/.gitignore: New file. * docs/examples/python/.gitignore: New file. * gnulib/lib/.gitignore: New file. * gnulib/lib/arpa/.gitignore: New file. * gnulib/lib/netinet/.gitignore: New file. * gnulib/lib/sys/.gitignore: New file. * gnulib/tests/.gitignore: New file. * include/.gitignore: New file. * include/libvirt/.gitignore: New file. * po/.gitignore: New file. * proxy/.gitignore: New file. * python/.gitignore: New file. * python/tests/.gitignore: New file. * qemud/.gitignore: New file. * src/.gitignore: New file. * tests/.gitignore: New file. * tests/confdata/.gitignore: New file. * tests/sexpr2xmldata/.gitignore: New file. * tests/virshdata/.gitignore: New file. * tests/xencapsdata/.gitignore: New file. * tests/xmconfigdata/.gitignore: New file. * tests/xml2sexprdata/.gitignore: New file.
* Xen interface order and fix python parallel buildDaniel Veillard2008-10-011-1/+1
| | | | | | | * src/xend_internal.c: fix ordering when parsing multiple Xen interfaces, patch by Jim Fehlig * python/Makefile.am: fix parallel build Daniel
* Use libvirt error message for python exceptionsv0.4.6Daniel P. Berrange2008-08-221-10/+11
|