summaryrefslogtreecommitdiffstats
path: root/libvir.c
Commit message (Collapse)AuthorAgeFilesLines
* Fix UUID handling in secrets/storage encryption APIsDaniel P. Berrange2009-09-141-0/+79
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 successsubmission-5Jim 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-011-0/+100
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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'
* Fix python domain events example & bindingv0.6.5v0.6.4LIBVIRT_0_6_5LIBVIRT_0_6_4Daniel P. Berrange2009-05-281-0/+1
|
* Use global thread-local error for all python error reportingv0.6.0LIBVIRT_0_6_0Daniel P. Berrange2009-01-201-22/+22
|
* Support domain lifecycle events for Xen (Ben Guthro & Daniel Berrange)v0.5.1v0.5.0LIBVIRT_0_5_1LIBVIRT_0_5_0Daniel P. Berrange2008-11-251-1/+2
|
* Fix python bindings events code (David Lively)Daniel P. Berrange2008-11-241-37/+166
|
* Python binding for node device APIs (David Lively)Daniel P. Berrange2008-11-211-0/+86
|
* Add a virFreeCallback to event loop APIsDaniel P. Berrange2008-11-191-6/+17
|
* 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/Makefile.am python/generator.py python/libvir.cDaniel Veillard2008-10-311-0/+441
| | | | | | | | | | 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
* * python/generator.py python/libvir.c python/libvirt-python-api.xml:Daniel Veillard2008-06-101-0/+82
| | | | | Apply patch from Cole Robinson fixing UUIDString for python Daniel
* Work around Python.h name-space pollution.Jim Meyering2008-04-181-1/+6
| | | | | * python/libvir.c (HAVE_PTHREAD_H): #undef. Without this, we'd get a redefinition warning.
* convert TAB-based indentation in C sources to use only spacesJim Meyering2008-04-101-17/+17
| | | | | | Done using this command (also includes .c.in and .h.in files): for i in $(g ls-files|grep -E '\.[ch](\.in)?$'|grep -v gnulib); do expand -i $i > j && mv j $i;done
* remove Vim and Emacs variable settings from C source filesJim Meyering2008-04-101-14/+0
| | | | | | | | | Done with these commands: git grep -l Local.variab|xargs \ perl -0x3b -pi -e 's,\n+/\*\n \* vim:(.|\n)*,\n,' git grep -l Local.variab|xargs \ perl -0x3b -pi -e 's,\n+/\*\n \* Local variables:\n(.|\n)*,\n,'
* Many typos fixed (Atsushi SAKAI).v0.4.1LIBVIRT_0_4_1Richard W.M. Jones2008-02-291-5/+5
|
* Added python binding for storage APIsDaniel P. Berrange2008-02-201-0/+293
|
* Python bindings return values fixesDaniel Veillard2008-02-071-11/+13
| | | | | | * python/libvir.c: apply patch from Cole Robinson to provide return values for manulally written python bindings. Daniel
* Remove all trailing blanks; turn on the rule to detect them.Jim Meyering2008-02-051-3/+3
| | | | | * Makefile.cfg (local-checks-to-skip): Remove sc_trailing_blank. * .x-sc_trailing_blank: New file, to exempt the few binary files.
* Enable the <config.h>-requiring test; fix violationsJim Meyering2008-01-291-1/+1
| | | | | | | Use <config.h>, not "config.h", per autoconf documentation. * Makefile.cfg (local-checks-to-skip) [sc_require_config_h]: Enable. * .x-sc_require_config_h: New file, to list exempted files. * Makefile.am (EXTRA_DIST): Add .x-sc_require_config_h.
* Make python generator fail build on any missing APIsDaniel P. Berrange2008-01-211-75/+10
|
* Add missing vcpu/schedular APIs to python bindingDaniel P. Berrange2008-01-211-0/+318
|
* Handle PyTuple_New's malloc failure.Jim Meyering2008-01-171-6/+10
| | | | | | | * python/libvir.c (libvirt_virDomainBlockStats): Handle a NULL return from PyTuple_New. (libvirt_virDomainInterfaceStats, libvirt_virGetLastError): Likewise. (libvirt_virConnGetLastError): Likewise.
* Factor out some duplication.Jim Meyering2008-01-171-103/+58
| | | | | | * python/libvir.c (VIR_PY_NONE): New macro, to encapsulate a common two-statement sequence. Replace all such 2-stmt sequences.
* Use a variable name as sizeof argument, not a type name.Jim Meyering2007-12-111-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Given code like: T *var = calloc (n, sizeof (T)); Convert to this: T *var = calloc (n, sizeof (*var)); This first-cut change adjusts all malloc, calloc, and realloc statements. The only binary differences are in remote_internal.c (due to the bug fix) and in xmlrpc.c (due to factorization). * python/libvir.c: As above. * qemud/event.c: Likewise. * qemud/mdns.c: Likewise. * qemud/qemud.c: Likewise. * qemud/remote.c: Likewise. * src/bridge.c: Likewise. * src/buf.c: Likewise. * src/conf.c: Likewise. * src/hash.c: Likewise. * src/iptables.c: Likewise. * src/openvz_conf.c: Likewise. * src/qemu_conf.c: Likewise. * src/qemu_driver.c: Likewise. * src/test.c: Likewise. * src/xen_internal.c: Likewise. * src/xen_unified.c: Likewise. * src/xm_internal.c: Likewise. * src/xml.c: Likewise. * tests/qemuxml2argvtest.c: Likewise. * src/xmlrpc.c (xmlRpcValuePtr): Likewise, and minor factorization. * src/remote_internal.c (remoteAuthMakeCredentials): Use the right type when allocating space for an array of cred _pointers_.
* Include "config.h" in remaining non-generated files.Jim Meyering2007-12-071-1/+3
| | | | | | | | | | * proxy/libvirt_proxy.c: Likewise. * python/libvir.c: Likewise. * python/types.c: Likewise. * src/event.c: Likewise. * src/xm_internal.c: Likewise. * tests/reconnect.c: Likewise. * tests/testutils.c: Likewise.
* * python/generator.py python/libvir.c python/libvirt-python-api.xml:Daniel Veillard2007-12-071-0/+40
| | | | | add a python binding for virNodeGetCellsFreeMemory Daniel
* Add manual impl of virConnectOpenAuth python bindingDaniel P. Berrange2007-12-051-0/+123
|
* Wed Dec 5 13:48:00 UTC 2007 Richard W.M. Jones <rjones@redhat.com>Richard W.M. Jones2007-12-051-2/+2
| | | | | | | | | | | | | | | | | | | * python/libvir.c, python/libvirt_wrap.h, qemud/qemud.c, qemud/remote.c, src/internal.h, src/openvz_conf.c, src/openvz_driver.c, src/proxy_internal.h, src/qemu_conf.c, src/qemu_driver.c, src/remote_internal.h, src/test.h, src/util.c, src/xen_unified.c, src/xen_unified.h, tests/nodeinfotest.c, tests/qemuxml2argvtest.c, tests/qemuxml2xmltest.c, tests/reconnect.c, tests/sexpr2xmltest.c, tests/virshtest.c, tests/xencapstest.c, tests/xmconfigtest.c, tests/xml2sexprtest.c: Change #include <> to #include "" for local includes. Removed many includes from src/internal.h and put them in the C files which actually use them. Removed <ansidecl.h> - unused. Added a comment around __func__. Removed a clashing redefinition of VERSION symbol. All limits (PATH_MAX etc) now done in src/internal.h, so we don't need to include those headers in other files.
* Fri Nov 30 11:04:00 GMT 2007 Richard W.M. Jones <rjones@redhat.com>Richard W.M. Jones2007-11-301-2/+17
| | | | | | | | | * python/libvir.c, python/libvir.py: Make Python aware that the C bindings module is called cygvirtmod.dll when compiled by CYGWIN. * python/Makefile.am: Remove symlink libvirtmod.dll -> cygvirtmod.dll no longer necessary because of the above. * configure.in: Remove AM_CONDITIONAL(CYGWIN).
* * python/generator.py python/libvir.c python/libvirt-python-api.xml:v0.3.3LIBVIRT_0_3_3Daniel Veillard2007-09-301-0/+71
| | | | | provide bindings for block and interface statistics Daniel
* +Tue May 29 15:56:00 BST 2007 Richard W.M. Jones <rjones@redhat.com>v0.2.3LIVIRT_0_2_3Richard W.M. Jones2007-05-291-0/+45
| | | | | | | | | | + + * python/generator.py, python/libvir.c, python/libvir.py: + Wrap the virGetVersion call as Python libvirt.getVersion. + + * src/libvirt.c: Change virGetVersion so that the driver name + is case insensitive. +
* Added vir*GetAutostart APIs to pythonDaniel P. Berrange2007-04-101-0/+52
|
* Added python bindings for networking APIsDaniel P. Berrange2007-03-091-1/+177
|
* Fixed up numerous compiler warningsDaniel P. Berrange2007-03-061-3/+3
|
* Mon Jan 23 14:36:18 IST 2007 Mark McLoughlin <markmc@redhat.com>Mark McLoughlin2007-01-231-3/+3
| | | | | | | | | | | | * include/libvirt/libvirt.h.in: add VIR_UUID_BUFLEN and VIR_UUID_STRING_BUFLEN * libvirt/proxy/libvirt_proxy.c, libvirt/src/hash.c, libvirt/src/internal.h, libvirt/src/libvirt.c, libvirt/src/proxy_internal.c, libvirt/src/test.c, libvirt/src/virsh.c, libvirt/src/xend_internal.c, libvirt/src/xm_internal.c, libvirt/src/xml.c, libvirt/python/libvir.c: use them
* Added binding for virConnectListDefinedDomains apiv0.1.9v0.1.11v0.1.10LIBVIRT_0_1_9LIBVIRT_0_1_11LIBVIRT_0_1_10Daniel P. Berrange2006-11-161-0/+47
|
* Fix unsigned long wraparound in python bindingDaniel P. Berrange2006-11-151-2/+2
|
* Propagate libvirt errors back with python exceptionsDaniel P. Berrange2006-11-071-0/+60
|
* Make python bindings threaded, by dropping/acquiring Python GIL where neededDaniel P. Berrange2006-10-241-1/+24
|
* * python/libvir.c: Pete Vetere pointed out a bug in string castv0.1.8v0.1.7v0.1.6LIBVIRT_0_1_8LIBVIRT_0_1_7LIBVIRT_0_1_6Daniel Veillard2006-08-291-4/+4
| | | | | when handling errors in Python Daniel
* * configure.in libvirt.spec.in docs/examples/* include/Makefile.amDaniel Veillard2006-06-261-2/+2
| | | | | | | | | | include/libvirt/virterror.h python/generator.py python/libvir.c python/libvirt_wrap.h src/driver.h src/internal.h src/test.h src/virsh.c src/virterror.c src/xend_internal.c src/xend_internal.h src/xml.c src/xml.h: moved the includes from include/ to include/libvirt to reflect the installed include tree. This avoid using "" in the includes themselves. Daniel
* * python/libvir.c: fixed a bug in the new wrapperv0.1.1v0.1.0LIBVIRT_0_1_1LIBVIRT_0_1_0Daniel Veillard2006-03-291-2/+2
| | | | | | | * python/tests/Makefile.am python/tests/node.py: added a new test for the new API * python/tests/create.py: remove a debug Daniel
* * include/libvirt.h[.in] include/virterror.h src/driver.hDaniel Veillard2006-03-291-0/+30
| | | | | | | | | | | src/internal.h src/libvirt_sym.version src/xen_internal.c src/xs_internal.c: added a new entry point to get node hardware informations virGetNodeInfo, and associated driver hook. * src/xend_internal.c: implemented the node and version information hooks for the Xen Daemon * python/libvir.c python/libvirt-python-api.xml python/generator.py: also added Python bindings for the new call Daniel
* * python/libvir.c: call the initialize entry pointDaniel Veillard2006-03-281-0/+2
| | | | | | | | * src/libvirt_sym.version: add initialize entry point * src/libvirt.c: make sure we always initialize the lib * python/tests/*.py: start updating exemple for exception handling as pointed by Jim Meyering Daniel
* * TODO: updatedDaniel Veillard2006-02-281-1/+98
| | | | | | | | | | * python/Makefile.am python/generator.py python/libvir.c python/libvir.py: improved python binding, raise exception when an instance creation or lookup fails, and add support for the global error handler, per conn handler still needed * python/tests/error.py python/tests/Makefile.am: adding a regression test Daniel
* * python/generator.py python/libvir.c python/libvirt-python-api.xml:Daniel Veillard2006-02-241-0/+24
| | | | | | UUID strings can contain zeroes, so the autogenerated conversion functions don't work. Daniel