summaryrefslogtreecommitdiffstats
path: root/libvirt-override.c
Commit message (Collapse)AuthorAgeFilesLines
* remove a static limit on max domains in python bindingsDaniel Veillard2011-12-291-4/+23
| | | | | | * python/libvirt-override.c: remove the predefined array in the virConnectListDomainsID binding and call virConnectNumOfDomains to do a proper allocation
* python: Fix problems of virDomain{Set, Get}BlockIoTune bindingsAlex Jia2011-12-291-2/+2
| | | | | | | | | | | | | | | | | | The parameter 'params' is useless for virDomainGetBlockIoTune API, and the return value type should be a virTypedParameterPtr but not integer. And "PyArg_ParseTuple" in functions libvirt_virDomain{Set,Get}BlockIoTune misses format unit for "format" argument. * libvirt-override-api.xml: Remove useless the parameter 'params' from virDomainGetBlockIoTune API, and change return value type from integer to virTypedParameterPtr. * python/libvirt-override.c: Add the missed format units. RHBZ: https://bugzilla.redhat.com/show_bug.cgi?id=770683 Signed-off-by: Alex Jia <ajia@redhat.com>
* python: plug memory leak on libvirt_virConnectOpenAuthAlex Jia2011-12-191-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Detected by valgrind. Leak introduced in commit 5ab109f. * python/libvirt-override.c: avoid memory leak on libvirt_virConnectOpenAuth. * How to reproduce? % valgrind -v --leak-check=full virt-clone --print-xml Note: it can hit the issue although options are incomplete. * Actual valgrind result: ==1801== 12 bytes in 1 blocks are definitely lost in loss record 25 of 3,270 ==1801== at 0x4A05FDE: malloc (vg_replace_malloc.c:236) ==1801== by 0xCF1F60E: libvirt_virConnectOpenAuth (libvirt-override.c:1507) ==1801== by 0x3AFEEDE7F3: PyEval_EvalFrameEx (ceval.c:3794) ==1801== by 0x3AFEEDF99E: PyEval_EvalFrameEx (ceval.c:3880) ==1801== by 0x3AFEEDF99E: PyEval_EvalFrameEx (ceval.c:3880) ==1801== by 0x3AFEEDF99E: PyEval_EvalFrameEx (ceval.c:3880) ==1801== by 0x3AFEEDF99E: PyEval_EvalFrameEx (ceval.c:3880) ==1801== by 0x3AFEEE0466: PyEval_EvalCodeEx (ceval.c:3044) ==1801== by 0x3AFEEE0541: PyEval_EvalCode (ceval.c:545) ==1801== by 0x3AFEEFB88B: run_mod (pythonrun.c:1351) ==1801== by 0x3AFEEFB95F: PyRun_FileExFlags (pythonrun.c:1337) ==1801== by 0x3AFEEFCE4B: PyRun_SimpleFileExFlags (pythonrun.c:941) Signed-off-by: Alex Jia <ajia@redhat.com>
* python: Expose blockPeek and memoryPeek in Python bindingOsier Yang2011-12-151-0/+73
| | | | | | | | | | | | | | | | | | | | | | | A simple example to show how to use it: \#! /usr/bin/python import os import sys import libvirt disk = "/var/lib/libvirt/images/test.img" conn = libvirt.open(None) dom = conn.lookupByName('test') mem_contents = dom.memoryPeek(0, 32, libvirt.VIR_MEMORY_VIRTUAL); sys.stdout.write(mem_contents) % python test.py | hexdump 0000000 1660 0209 0000 0000 0000 0000 0000 0000 0000010 0000 0000 0000 0000 d3a0 01d0 0000 0000 0000020
* python: Fix export of virDomainSnapshotListChildrenNamesPeter Krempa2011-12-131-0/+1
| | | | | | | | Commit f2013c9dd1ce468b8620ee35c232a93ef7026fb0 added implementation of virDomainSnapshotListChildrenNames override export, but registration of the newly exported function was not added. *python/libvirt-override.c: - register export of function
* python: Expose binding for virNodeGetMemoryStats()v0.9.8Peter Krempa2011-12-051-0/+48
| | | | | | This patch adds binding for virNodeGetMemoryStats method of libvirtd. Return value is represented as a python dictionary mapping field names to values.
* python: Expose binding for virNodeGetCPUStats()Peter Krempa2011-12-051-0/+47
| | | | | | This patch adds binding for virNodeGetCPUStats method of libvirtd. Return value is represented as a python dictionary mapping field names to values.
* Support virDomain{Set, Get}BlockIoTune in the python APIv0.9.8-rc2v0.9.8-rc1Lei Li2011-11-301-0/+178
| | | | | | | | Python support for both setting and getting block I/O throttle. Signed-off-by: Lei Li <lilei@linux.vnet.ibm.com> Signed-off-by: Zhi Yong Wu <wuzhy@linux.vnet.ibm.com> Signed-off-by: Eric Blake <eblake@redhat.com>
* startupPolicy: Emit event on disk source droppingv0.9.7-rc1Michal Privoznik2011-10-251-0/+53
| | | | | | | | | | If a disk source gets dropped because it is not accessible, mgmt application might want to be informed about this. Therefore we need to emit an event. The event presented in this patch is however a bit superset of what written above. The reason is simple: an intention to be easily expanded, e.g. on 'user ejected disk in guest' events. Therefore, callback gets source string and disk alias (which should be unique among a domain) and reason (an integer);
* snapshot: new virDomainSnapshotListChildrenNames APIEric Blake2011-10-101-0/+45
| | | | | | | | | | | | | | | | | | | | | | The previous API addition allowed traversal up the hierarchy; this one makes it easier to traverse down the hierarchy. In the python bindings, virDomainSnapshotNumChildren can be generated, but virDomainSnapshotListChildrenNames had to copy from the hand-written example of virDomainSnapshotListNames. * include/libvirt/libvirt.h.in (virDomainSnapshotNumChildren) (virDomainSnapshotListChildrenNames): New prototypes. (VIR_DOMAIN_SNAPSHOT_LIST_DESCENDANTS): New flag alias. * src/libvirt.c (virDomainSnapshotNumChildren) (virDomainSnapshotListChildrenNames): New functions. * src/libvirt_public.syms: Export them. * src/driver.h (virDrvDomainSnapshotNumChildren) (virDrvDomainSnapshotListChildrenNames): New callbacks. * python/generator.py (skip_impl, nameFixup): Update lists. * python/libvirt-override-api.xml: Likewise. * python/libvirt-override.c (libvirt_virDomainSnapshotListChildrenNames): New wrapper function.
* latency: Expose the new API for Python bindingv0.9.5-rc1Osier Yang2011-09-061-0/+85
|
* Add public API for getting migration speedJim Fehlig2011-09-011-0/+24
| | | | | | | | | Includes impl of python binding since the generator was not able to cope. Note: Requires gendispatch.pl patch from Matthias Bolte https://www.redhat.com/archives/libvir-list/2011-August/msg01367.html
* python: avoid unlikely sign extension bugv0.9.4Eric Blake2011-08-021-1/+1
| | | | | | | Detected by Coverity; same analysis as for commit f73198df. * python/libvirt-override.c (libvirt_virDomainGetVcpuPinInfo): Use correct type.
* python: add python binding for virDomainSetMemoryParametersHu Tao2011-07-281-3/+91
|
* python: add python binding for virDomainGetMemoryParametersHu Tao2011-07-281-3/+76
|
* python: add python binding for virDomainSetBlkioParametersHu Tao2011-07-281-3/+91
|
* python: add python binding for virDomainGetBlkioParametersHu Tao2011-07-281-3/+76
|
* send-key: Implement Python APILai Jiangshan2011-07-271-0/+48
| | | | Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
* python: Properly report errors if virStreamRecv failsCole Robinson2011-07-261-1/+3
| | | | | We only want to raise the special value -2. -1 should return None which tells the bindings to throw an exception.
* python: Handle embedded NUL in stream.send datav0.9.4-rc1Cole Robinson2011-07-251-2/+3
| | | | Otherwise things like volume upload are only useful with text data.
* python: add Python binding for virDomainGetVcpuPinInfo APITaku Izumi2011-07-251-0/+69
| | | | | | | This patch adds the Python bindings for virDomainGetVcpuPinInfo API. * python/generator.py: add it to generator skip list * python/libvirt-override-api.xml: provide an override description * python/libvirt-override.c: provide an override binding implementation
* python: add Python binding for virDomainPinVcpusFlags APITaku Izumi2011-07-251-0/+48
| | | | | | | This patch adds the Python bindings for virDomainPinVcpuFlags API. * python/generator.py: add it to the generator skip list * python/libvirt-override-api.xml: provide override description * python/libvirt-override.c: provide override bindings implementation
* python: add Python binding for virDomainGetSchedulerParametersFlags APITaku Izumi2011-07-251-0/+96
| | | | | This patch adds the Python bindings for virDomainGetSchedulerParametersFlags API.
* python: add Python binding for virDomainGetSchedulerParametersFlags APITaku Izumi2011-07-251-0/+83
| | | | | | | This patch adds the Python bindings for virDomainGetSchedulerParametersFlags API. * python/libvirt-override-api.xml: provide and override description * python/libvirt-override.c: implement the bindings
* Asynchronous event for BlockJob completionAdam Litke2011-07-221-0/+52
| | | | | | | | | | | | | | | | | | | | When an operation started by virDomainBlockPull completes (either with success or with failure), raise an event to indicate the final status. This API allow users to avoid polling on virDomainGetBlockJobInfo if they would prefer to use an event mechanism. * daemon/remote.c: Dispatch events to client * include/libvirt/libvirt.h.in: Define event ID and callback signature * src/conf/domain_event.c, src/conf/domain_event.h, src/libvirt_private.syms: Extend API to handle the new event * src/qemu/qemu_driver.c: Connect to the QEMU monitor event for block_stream completion and emit a libvirt block pull event * src/remote/remote_driver.c: Receive and dispatch events to application * src/remote/remote_protocol.x: Wire protocol definition for the event * src/remote_protocol-structs: structure definitions for protocol verification * src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h, src/qemu/qemu_monitor_json.c: Watch for BLOCK_STREAM_COMPLETED event from QEMU monitor
* Enable virDomainBlockPull in the python APIAdam Litke2011-07-221-0/+39
| | | | | | | | | virDomainGetBlockJobInfo requires manual override since it returns a custom type. * python/generator.py: reenable bindings for this entry point * python/libvirt-override-api.xml python/libvirt-override.c: manual overrides
* python: prefer unsigned flagsEric Blake2011-07-131-3/+3
| | | | | | * python/libvirt-override.c (libvirt_virConnectOpenAuth) (libvirt_virDomainSnapshotListNames) (libvirt_virDomainRevertToSnapshot): Change flags type.
* python: Fix bogus label placementMatthias Bolte2011-07-071-5/+3
|
* Revert "Enable virDomainBlockPull in the python API."Eric Blake2011-06-241-53/+0
| | | | | | | | This reverts commit d74b86f5d6ecae3d18a391f90a918fcac75914db. Conflicts: python/generator.py
* Revert "Asynchronous event for BlockPull completion"Eric Blake2011-06-241-51/+0
| | | | | | | | | | This reverts commit 12cd77a0c58a80179182f7d09e8e73f9f66b4677. Conflicts: python/libvirt-override-virConnect.py python/libvirt-override.c src/remote/remote_protocol.x
* python: Mark event callback wrappers as privateCole Robinson2011-06-211-12/+12
| | | | | | | | 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.
* python: Add bindings for virEvent*Handle/TimeoutCole Robinson2011-06-211-27/+165
|
* python: Implement virStreamSend/RecvCole Robinson2011-06-211-0/+62
| | | | | | | The return values for the python version are different that the C version of virStreamSend: on success we return a string, an error raises an exception, and if the stream would block we return int(-2). We need to do this since strings aren't passed by reference in python.
* python: Implement bindings for virStreamEventAddCallbackCole Robinson2011-06-201-0/+81
| | | | | v2: Don't generate virStreamFree
* python: libvirt-override: use simpler debugCole Robinson2011-06-201-104/+57
| | | | | | | | In a couple instances we have to mark a debug variable as ATTRIBUTE_UNUSED to avoid warnings. v2: Use #if 0 to comment out debug define
* Introduce virDomainGetControlInfo APIJiri Denemark2011-06-161-0/+27
| | | | | | The API can be used to query current state of an interface to VMM used to control a domain. In QEMU world this translates into monitor connection.
* Asynchronous event for BlockPull completionAdam Litke2011-06-141-0/+51
| | | | | | | | | | | | | | | | | | | | | When an operation started by virDomainBlockPullAll completes (either with success or with failure), raise an event to indicate the final status. This allows an API user to avoid polling on virDomainBlockPullInfo if they would prefer to use the event mechanism. * daemon/remote.c: Dispatch events to client * include/libvirt/libvirt.h.in: Define event ID and callback signature * src/conf/domain_event.c, src/conf/domain_event.h, src/libvirt_private.syms: Extend API to handle the new event * src/qemu/qemu_driver.c: Connect to the QEMU monitor event for block_stream completion and emit a libvirt block pull event * src/remote/remote_driver.c: Receive and dispatch events to application * src/remote/remote_protocol.x: Wire protocol definition for the event * src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h, src/qemu/qemu_monitor_json.c: Watch for BLOCK_STREAM_COMPLETED event from QEMU monitor Signed-off-by: Adam Litke <agl@us.ibm.com>
* Enable virDomainBlockPull in the python API.Adam Litke2011-06-141-0/+53
| | | | | | | | | | | | | virDomainBlockPullAll and virDomainBlockPullAbort are handled automatically. virDomainBlockPull and virDomainBlockPullInfo require manual overrides since they return a custom type. * python/generator.py: reenable bindings for this entry point * python/libvirt-override-api.xml python/libvirt-override.c: manual overrides Signed-off-by: Adam Litke <agl@us.ibm.com> Acked-by: Daniel P. Berrange <berrange@redhat.com>
* python: avoid unlikely sign extension bugEric Blake2011-06-081-1/+1
| | | | | | | | | | | | | | | | | 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.
* Introduce a new event emitted when a virtualization failure occursv0.9.2CVE-2011-2178Daniel P. Berrange2011-05-291-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This introduces a new domain VIR_DOMAIN_EVENT_ID_CONTROL_ERROR Which uses the existing generic callback typedef void (*virConnectDomainEventGenericCallback)(virConnectPtr conn, virDomainPtr dom, void *opaque); This event is intended to be emitted when there is a failure in some part of the domain virtualization system. Whether the domain continues to run/exist after the failure is an implementation detail specific to the hypervisor. The idea is that with some types of failure, hypervisors may prefer to leave the domain running in a "degraded" mode of operation. For example, if something goes wrong with the QEMU monitor, it is possible to leave the guest OS running quite happily. The mgmt app will simply loose the ability todo various tasks. The mgmt app can then choose how/when to deal with the failure that occured. * daemon/remote.c: Dispatch of new event * examples/domain-events/events-c/event-test.c: Demo catch of event * include/libvirt/libvirt.h.in: Define event ID and callback * src/conf/domain_event.c, src/conf/domain_event.h: Internal event handling * src/remote/remote_driver.c: Receipt of new event from daemon * src/remote/remote_protocol.x: Wire protocol for new event * src/remote_protocol-structs: add new event for checks
* libvirt.h: avoid regression, and document preferred nameEric Blake2011-05-291-14/+14
| | | | | | | | | | | | | | | | | | Commit 824dcaff was a regression (thankfully unreleased) for any client code that used 'struct _virSchedParameter' directly rather than the preferred virSchedParameter typedef. Adding a #define avoids even that API change, while rearranging the file makes it clear what the old vs. new API is. * include/libvirt/libvirt.h.in: Rearrange older names to the bottom and improve documentation on preferred names. (virDomainGetSchedulerParameters, virDomainSetSchedulerParameters) (virDomainSetSchedulerParametersFlags) (virDomainSetBlkioParameters, virDomainGetBlkioParameters) (virDomainSetMemoryParameters, virDomainGetMemoryParameters): Use newer type names. * python/libvirt-override.c: Adjust code generation to cope. Suggested by Daniel P. Berrange.
* python: Don't free must-not-free variablesMichal Privoznik2011-05-241-8/+3
| | | | | | py_str() function call PyString_AsString(). As written in documentation, the caller must not free the returned value, because it points to some internal structures.
* python: Fix typo in bindingsMichal Privoznik2011-05-231-1/+1
| | | | This typo caused a bug in which we wanted to free() invalid pointer.
* virDomainGetState public APIJiri Denemark2011-05-161-0/+30
| | | | | This API is supposed to replace virDomainGetInfo when the only purpose of calling it is getting current domain status.
* libvirt: add virDomain{Get,Set}BlkioParametersCVE-2011-1146Gui Jianfeng2011-03-101-1/+20
| | | | | | Add virDomainSetBlkioParameters virDomainGetBlkioParameters Signed-off-by: Gui Jianfeng <guijianfeng@cn.fujitsu.com>
* Fix several minor problems introduced by the memtune seriesv0.8.5Matthias Bolte2010-10-121-2/+4
| | | | | | | | | | | | | | Add proper documentation to the new VIR_DOMAIN_MEMORY_* macros in libvirt.h.in to placate apibuild.py. Mark args as unused in for libvirt_virDomain{Get,Set}MemoryParameters in the Python bindings and add both to the libvirtMethods array. Update remote_protocol-structs to placate make syntax-check. Undo unintended modifications in vboxDomainGetInfo. Update the function table of the VirtualBox and XenAPI drivers.
* Adding structure and defines for virDomainSet/GetMemoryParametersNikunj A. Dadhania2010-10-121-0/+14
| | | | | | | | | | | | | | | | | | | | | This patch adds a structure virMemoryParameter, it contains the name of the parameter and the type of the parameter along with a union. dv: + rename enums to VIR_DOMAIN_MEMORY_PARAM_* + remove some extraneous tabs v4: + Add unsigned int flags to the public api for future extensions v3: + Protoype for virDomainGetMemoryParameters and dummy python binding. v2: + Includes dummy python bindings for the library to build cleanly. + Define string constants like "hard_limit", etc. + re-order this patch.
* python: Fix IOErrorReasonCallback bindingsCole Robinson2010-07-141-1/+1
| | | | | A copy and paste error was causing us to dispatch the incorrect routine. Spotted by Dan Kenigsberg.
* Fix up the python bindings for snapshotting.Chris Lalancette2010-05-201-0/+23
| | | | | | | | | | | | | | | | | | | | | | | | This involved a few fixes. To start with, an virDomainSnapshot object is really tied to a domain, not a connection, so we have to generate a slightly different object so that we can get at self._dom for the object. Next, we had to "dummy" up an override piece of XML with a bogus argument that the function doesn't actually take. That's so that the generator places virDomainRevertToSnapshot underneath the correct class (namely, the virDomain class). Finally, we had to hand-implement the virDomainRevertToSnapshot implementation, ignoring the bogus pointer we are being passed. With all of this in place, I was able to successfully take a snapshot and revert to it using only the Python bindings. Signed-off-by: Chris Lalancette <clalance@redhat.com>
* python: don't ignore virInitialize failure in module initializationJim Meyering2010-05-181-1/+2
| | | | | * python/libvirt-override.c (initlibvirtmod): Upon virInitialize failure, skip the Py_InitModule call.