summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* python: Use hardcoded python path in libvirt.pyv0.9.1v0.9.0CVE-2011-1486Jiri Denemark2011-03-143-7/+7
| | | | | | | | | | | | | | | | This partially reverts (and fixes that part in a different way) commit e4384459c93e3e786aa483c7f077d1d22148f689, 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.
* libvirt: add virDomain{Get,Set}BlkioParametersCVE-2011-1146Gui Jianfeng2011-03-103-1/+34
| | | | | | Add virDomainSetBlkioParameters virDomainGetBlkioParameters Signed-off-by: Gui Jianfeng <guijianfeng@cn.fujitsu.com>
* maint: fix grammar in error messageEric Blake2011-02-211-2/+2
| | | | * python/tests/create.py: Use correct wording.
* maint: Expand tabs in python codeJiri Denemark2011-02-182-293/+293
| | | | | Also cfg.mk is tweaked to force this for all future changes to *.py files.
* python: Use PyCapsule API if availablev0.8.8Cole Robinson2011-01-101-39/+50
| | | | | | | | | | On Fedore 14, virt-manager spews a bunch of warnings to the console: /usr/lib64/python2.7/site-packages/libvirt.py:1781: PendingDeprecationWarning: The CObject type is marked Pending Deprecation in Python 2.7. Please use capsule objects instead. Have libvirt use the capsule API if available. I've verified this compiles fine on older python (2.6 in RHEL6 which doesn't have capsules), and virt-manager seems to function fine.
* Use python discovered through env instead of hardcoding a pathv0.8.7v0.8.6Matthias Bolte2010-11-142-1/+6
| | | | | | | | 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.
* 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-123-0/+28
| | | | | | | | | | | | | | | | | | | | | 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: drop unnecessary conn assignmentDan Kenigsberg2010-09-271-9/+0
| | | | | | Since 554d82a200289938d5639a782a9f12e3e2e968f0, conn is unused. Let's drop it - but keep the signature of the constructor for backward compatibility.
* Fix SEGV on exit after domainEventDeregister()v0.8.4v0.8.3Philipp Hahn2010-07-231-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | When the last callback is removed using domainEventDeregister(), the events dispatcher is deregistered from the C-library, but domainEventsCallbacks is still an empty list. On shutdown __del__() deregisters the dispatacher again, which SEGVs # You need the event-loop implementation from the Python examples; # give the file a name which is importable by Python. ln examples/domain-events/events-python/event-test.py eloop.py python -c 'from eloop import * import sys def dump(*args): print " ".join(map(str, args)) virEventLoopPureStart() c = libvirt.open("xen:///") c.domainEventRegister(dump, None) c.domainEventDeregister(dump) sys.exit(0)' domainEventDeregister() needs to delete domainEventCallbacks so subsequent calls to __del__() and domainEventRegister() choose the right code paths. Setting it to None is not enough, since calling domainEventRegiser() again would trigger an TypeError. Signed-off-by: Philipp Hahn <hahn@univention.de>
* 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.
* Ensure we return the callback ID in python events bindingDaniel P. Berrange2010-07-121-0/+1
| | | | | | | | | A missing return statement in the python binding meant that the callers could not get the callback ID, and thus not be able to unregister event callbacks * python/libvirt-override-virConnect.py: Add missing return statement
* Add missing parameter in python Disk IO error callbackv0.8.2Daniel P. Berrange2010-06-251-1/+1
| | | | | | | | The IO error callback was forgetting to pass the action parameter, causing a stack trace when IO errors arrive * python/libvirt-override-virConnect.py: Add missing action parameter in IO error callback
* Fix description of virStorageVolGetInfo()Philipp Hahn2010-06-181-1/+1
| | | | | | | | Probably a copy-paste-bug in python/libvirt-override-api.xml: virStorageVolGetInfo() extracts information about a "storage volume", not the "storage pool" as virStoragePoolGetInfo() does. Signed-off-by: Philipp Hahn <hahn@univention.de>
* maint: simplify some ignore filesEric Blake2010-06-151-2/+0
| | | | | | | | | | | | | | * .hgignore: Delete, no longer used. * examples/python/.gitignore: Delete, covered globally. * include/.gitignore: Likewise. * python/tests/.gitignore: Likewise. * docs/schemas/.gitignore: Likewise. * tests/xml2sexprdata/.gitignore: Likewise. * tests/sexpr2xmldata/.gitignore: Likewise. * tests/confdata/.gitignore: Likewise. * tests/xencapsdata/.gitignore: Likewise. * tests/xmconfigdata/.gitignore: Likewise. * tests/xml2sexprdata/.gitignore: Likewise.
* Fix up the python bindings for snapshotting.Chris Lalancette2010-05-203-3/+53
| | | | | | | | | | | | | | | | | | | | | | | | 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.
* Add support for another explicit IO error eventv0.8.1Daniel P. Berrange2010-04-302-1/+68
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This introduces a new event type VIR_DOMAIN_EVENT_ID_IO_ERROR_REASON This event is the same as the previous VIR_DOMAIN_ID_IO_ERROR event, but also includes a string describing the cause of the event. Thus there is a new callback definition for this event type typedef void (*virConnectDomainEventIOErrorReasonCallback)(virConnectPtr conn, virDomainPtr dom, const char *srcPath, const char *devAlias, int action, const char *reason, void *opaque); This is currently wired up to the QEMU block IO error events * daemon/remote.c: Dispatch IO error events to client * examples/domain-events/events-c/event-test.c: Watch for IO error events * include/libvirt/libvirt.h.in: Define new IO error event ID and callback signature * src/conf/domain_event.c, src/conf/domain_event.h, src/libvirt_private.syms: Extend API to handle IO error events * src/qemu/qemu_driver.c: Connect to the QEMU monitor event for block IO errors and emit a libvirt IO error event * src/remote/remote_driver.c: Receive and dispatch IO error events to application * src/remote/remote_protocol.x: Wire protocol definition for IO error events * src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h, src/qemu/qemu_monitor_json.c: Watch for BLOCK_IO_ERROR event from QEMU monitor
* Implement python binding for virDomainGetBlockInfoDaniel P. Berrange2010-04-293-0/+35
| | | | | | | | | | | | | | | This binds the virDomainGetBlockInfo API to python's blockInfo method on the domain object >>> c = libvirt.openReadOnly('qemu:///session') >>> d = c.lookupByName('demo') >>> f = d.blockInfo("/dev/loop0", 0) >>> print f [1048576000L, 104857600L, 104857600L] * python/libvirt-override-api.xml: Define override signature * python/generator.py: Skip C impl generator for virDomainGetBlockInfo * python/libvirt-override.c: Manual impl of virDomainGetBlockInfo
* nwfilter: python bindings for nwfilterStefan Berger2010-04-295-4/+198
| | | | | I have primarily followed the pattern of the 'secret' driver to provide support for the missing python bindings for the network filter API.
* Don't ship generated python/libvirt.? files.Philipp Hahn2010-04-201-1/+2
| | | | | | | | | | | | | libvirt.c and libvirt.h are auto-generated files. Mentioning their names in *_SOURCES includes them in the distribution. During an out-of-tree build these shipped files are included instead of the auto-generated version, potentially breaking the build (as it happend in 0.8.0, because the shipped libvirt.h was missing the declaration for 'libvirt_virDomainUpdateDeviceFlags') Use the nodist_*_SOURCES automake variable instead. Signed-off-by: Philipp Hahn <hahn@univention.de>
* Fixup python binding for virDomainSnapshot APIsDaniel P. Berrange2010-04-203-1/+78
| | | | | | | | | | The generator code was totally wrong for the virDomainSnapshot APIs, not generating the wrapper class, and giving methods the wrong names * generator.py: Set metadata for virDomainSnapshot type & APIs * libvirt-override-api.xml, libvirt-override.c: Hand-code the virDomainSnapshotListNames glue layer
* More event callback fixesv0.8.0Daniel P. Berrange2010-04-091-2/+50
| | | | | | | | | | | In a couple of cases typos meant we were firing the wrong type of event. In the python code my previous commit accidentally missed some chunks of the code. * python/libvirt-override-virConnect.py: Add missing python glue accidentally left out of previous commit * src/conf/domain_event.c, src/qemu/qemu_monitor_json.c: Fix typos in event name / method name to invoke
* Fix up python bindings for new event callbacksDaniel P. Berrange2010-04-082-0/+496
| | | | | | | | | | | | | The generator was disabled for the new event callbacks, since they need to be hand written. This patch adds the C and python glue to expose the new APIs in the python binding. The python example program is extended to demonstrate of the code * python/libvirt-override.c: Registration and dispatch of events at the C layer * python/libvirt-override-virConnect.py: Python glue for events * examples/domain-events/events-python/event-test.py: Demo use of new event callbacks
* Snapshot API framework.Chris Lalancette2010-04-053-0/+28
| | | | Signed-off-by: Chris Lalancette <clalance@redhat.com>
* Core driver implementation with ebtables supportStefan Berger2010-03-261-0/+2
| | | | | | | | | | | | | | This patch implements the core driver and provides - management functionality for managing the filter XMLs - compiling the internal filter representation into ebtables rules - applying ebtables rules on a network (tap,macvtap) interface - tearing down ebtables rules that were applied on behalf of an interface - updating of filters while VMs are running and causing the firewalls to be rebuilt - other bits and pieces Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
* Add domain events for graphics network clientsDaniel P. Berrange2010-03-261-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This introduces a new event type VIR_DOMAIN_EVENT_ID_GRAPHICS The same event can be emitted in 3 scenarios typedef enum { VIR_DOMAIN_EVENT_GRAPHICS_CONNECT = 0, VIR_DOMAIN_EVENT_GRAPHICS_INITIALIZE, VIR_DOMAIN_EVENT_GRAPHICS_DISCONNECT, } virDomainEventGraphicsPhase; Connect/disconnect are triggered at socket accept/close. The initialize phase is immediately after the protocol setup and authentication has completed. ie when the client is authorized and about to start interacting with the graphical desktop This event comes with *a lot* of potential information - IP address, port & address family of client - IP address, port & address family of server - Authentication scheme (arbitrary string) - Authenticated subject identity. A subject may have multiple identities with some authentication schemes. For example, vencrypt+sasl results in a x509dname and saslUsername identities. This results in a very complicated callback :-( typedef enum { VIR_DOMAIN_EVENT_GRAPHICS_ADDRESS_IPV4, VIR_DOMAIN_EVENT_GRAPHICS_ADDRESS_IPV6, } virDomainEventGraphicsAddressType; struct _virDomainEventGraphicsAddress { int family; const char *node; const char *service; }; typedef struct _virDomainEventGraphicsAddress virDomainEventGraphicsAddress; typedef virDomainEventGraphicsAddress *virDomainEventGraphicsAddressPtr; struct _virDomainEventGraphicsSubject { int nidentity; struct { const char *type; const char *name; } *identities; }; typedef struct _virDomainEventGraphicsSubject virDomainEventGraphicsSubject; typedef virDomainEventGraphicsSubject *virDomainEventGraphicsSubjectPtr; typedef void (*virConnectDomainEventGraphicsCallback)(virConnectPtr conn, virDomainPtr dom, int phase, virDomainEventGraphicsAddressPtr local, virDomainEventGraphicsAddressPtr remote, const char *authScheme, virDomainEventGraphicsSubjectPtr subject, void *opaque); The wire protocol is similarly complex struct remote_domain_event_graphics_address { int family; remote_nonnull_string node; remote_nonnull_string service; }; const REMOTE_DOMAIN_EVENT_GRAPHICS_IDENTITY_MAX = 20; struct remote_domain_event_graphics_identity { remote_nonnull_string type; remote_nonnull_string name; }; struct remote_domain_event_graphics_msg { remote_nonnull_domain dom; int phase; remote_domain_event_graphics_address local; remote_domain_event_graphics_address remote; remote_nonnull_string authScheme; remote_domain_event_graphics_identity subject<REMOTE_DOMAIN_EVENT_GRAPHICS_IDENTITY_MAX>; }; This is currently implemented in QEMU for the VNC graphics protocol, but designed to be usable with SPICE graphics in the future too. * daemon/remote.c: Dispatch graphics events to client * examples/domain-events/events-c/event-test.c: Watch for graphics events * include/libvirt/libvirt.h.in: Define new graphics event ID and callback signature * src/conf/domain_event.c, src/conf/domain_event.h, src/libvirt_private.syms: Extend API to handle graphics events * src/qemu/qemu_driver.c: Connect to the QEMU monitor event for VNC events and emit a libvirt graphics event * src/remote/remote_driver.c: Receive and dispatch graphics events to application * src/remote/remote_protocol.x: Wire protocol definition for graphics events * src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h, src/qemu/qemu_monitor_json.c: Watch for VNC_CONNECTED, VNC_INITIALIZED & VNC_DISCONNETED events from QEMU monitor
* Add support for an explicit IO error eventDaniel P. Berrange2010-03-261-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This introduces a new event type VIR_DOMAIN_EVENT_ID_IO_ERROR This event includes the action that is about to be taken as a result of the watchdog triggering typedef enum { VIR_DOMAIN_EVENT_IO_ERROR_NONE = 0, VIR_DOMAIN_EVENT_IO_ERROR_PAUSE, VIR_DOMAIN_EVENT_IO_ERROR_REPORT, } virDomainEventIOErrorAction; In addition it has the source path of the disk that had the error and its unique device alias. It does not include the target device name (/dev/sda), since this would preclude triggering IO errors from other file backed devices (eg serial ports connected to a file) Thus there is a new callback definition for this event type typedef void (*virConnectDomainEventIOErrorCallback)(virConnectPtr conn, virDomainPtr dom, const char *srcPath, const char *devAlias, int action, void *opaque); This is currently wired up to the QEMU block IO error events * daemon/remote.c: Dispatch IO error events to client * examples/domain-events/events-c/event-test.c: Watch for IO error events * include/libvirt/libvirt.h.in: Define new IO error event ID and callback signature * src/conf/domain_event.c, src/conf/domain_event.h, src/libvirt_private.syms: Extend API to handle IO error events * src/qemu/qemu_driver.c: Connect to the QEMU monitor event for block IO errors and emit a libvirt IO error event * src/remote/remote_driver.c: Receive and dispatch IO error events to application * src/remote/remote_protocol.x: Wire protocol definition for IO error events * src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h, src/qemu/qemu_monitor_json.c: Watch for BLOCK_IO_ERROR event from QEMU monitor
* Add support for an explicit watchdog eventDaniel P. Berrange2010-03-261-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This introduces a new event type VIR_DOMAIN_EVENT_ID_WATCHDOG This event includes the action that is about to be taken as a result of the watchdog triggering typedef enum { VIR_DOMAIN_EVENT_WATCHDOG_NONE = 0, VIR_DOMAIN_EVENT_WATCHDOG_PAUSE, VIR_DOMAIN_EVENT_WATCHDOG_RESET, VIR_DOMAIN_EVENT_WATCHDOG_POWEROFF, VIR_DOMAIN_EVENT_WATCHDOG_SHUTDOWN, VIR_DOMAIN_EVENT_WATCHDOG_DEBUG, } virDomainEventWatchdogAction; Thus there is a new callback definition for this event type typedef void (*virConnectDomainEventWatchdogCallback)(virConnectPtr conn, virDomainPtr dom, int action, void *opaque); * daemon/remote.c: Dispatch watchdog events to client * examples/domain-events/events-c/event-test.c: Watch for watchdog events * include/libvirt/libvirt.h.in: Define new watchdg event ID and callback signature * src/conf/domain_event.c, src/conf/domain_event.h, src/libvirt_private.syms: Extend API to handle watchdog events * src/qemu/qemu_driver.c: Connect to the QEMU monitor event for watchdogs and emit a libvirt watchdog event * src/remote/remote_driver.c: Receive and dispatch watchdog events to application * src/remote/remote_protocol.x: Wire protocol definition for watchdog events * src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h, src/qemu/qemu_monitor_json.c: Watch for WATCHDOG event from QEMU monitor
* Add support for an explicit RTC change eventDaniel P. Berrange2010-03-261-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This introduces a new event type VIR_DOMAIN_EVENT_ID_RTC_CHANGE This event includes the new UTC offset measured in seconds. Thus there is a new callback definition for this event type typedef void (*virConnectDomainEventRTCChangeCallback)(virConnectPtr conn, virDomainPtr dom, long long utcoffset, void *opaque); If the guest XML configuration for the <clock> is set to offset='variable', then the XML will automatically be updated with the new UTC offset value. This ensures that during migration/save/restore the new offset is preserved. * daemon/remote.c: Dispatch RTC change events to client * examples/domain-events/events-c/event-test.c: Watch for RTC change events * include/libvirt/libvirt.h.in: Define new RTC change event ID and callback signature * src/conf/domain_event.c, src/conf/domain_event.h, src/libvirt_private.syms: Extend API to handle RTC change events * src/qemu/qemu_driver.c: Connect to the QEMU monitor event for RTC changes and emit a libvirt RTC change event * src/remote/remote_driver.c: Receive and dispatch RTC change events to application * src/remote/remote_protocol.x: Wire protocol definition for RTC change events * src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h, src/qemu/qemu_monitor_json.c: Watch for RTC_CHANGE event from QEMU monitor
* Introduce a new public API for domain eventsDaniel P. Berrange2010-03-261-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The current API for domain events has a number of problems - Only allows for domain lifecycle change events - Does not allow the same callback to be registered multiple times - Does not allow filtering of events to a specific domain This introduces a new more general purpose domain events API typedef enum { VIR_DOMAIN_EVENT_ID_LIFECYCLE = 0, /* virConnectDomainEventCallback */ ...more events later.. } int virConnectDomainEventRegisterAny(virConnectPtr conn, virDomainPtr dom, /* Optional, to filter */ int eventID, virConnectDomainEventGenericCallback cb, void *opaque, virFreeCallback freecb); int virConnectDomainEventDeregisterAny(virConnectPtr conn, int callbackID); Since different event types can received different data in the callback, the API is defined with a generic callback. Specific events will each have a custom signature for their callback. Thus when registering an event it is neccessary to cast the callback to the generic signature eg int myDomainEventCallback(virConnectPtr conn, virDomainPtr dom, int event, int detail, void *opaque) { ... } virConnectDomainEventRegisterAny(conn, NULL, VIR_DOMAIN_EVENT_ID_LIFECYCLE, VIR_DOMAIN_EVENT_CALLBACK(myDomainEventCallback) NULL, NULL); The VIR_DOMAIN_EVENT_CALLBACK() macro simply does a "bad" cast to the generic signature * include/libvirt/libvirt.h.in: Define new APIs for registering domain events * src/driver.h: Internal driver entry points for new events APIs * src/libvirt.c: Wire up public API to driver API for events APIs * src/libvirt_public.syms: Export new APIs * src/esx/esx_driver.c, src/lxc/lxc_driver.c, src/opennebula/one_driver.c, src/openvz/openvz_driver.c, src/phyp/phyp_driver.c, src/qemu/qemu_driver.c, src/remote/remote_driver.c, src/test/test_driver.c, src/uml/uml_driver.c, src/vbox/vbox_tmpl.c, src/xen/xen_driver.c, src/xenapi/xenapi_driver.c: Stub out new API entries
* python: Fix networkLookupByUUIDPhilip Hahn2010-03-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | According to: http://libvirt.org/html/libvirt-libvirt.html#virNetworkLookupByUUID virNetworkLookupByUUID() expects a virConnectPtr as its first argument, thus making it a method of the virConnect Python class. Currently it's a method of libvirt.virNetwork. @@ -805,13 +805,6 @@ class virNetwork: if ret == -1: raise libvirtError ('virNetworkGetAutostart() failed', net=self) return ret - def networkLookupByUUID(self, uuid): - """Try to lookup a network on the given hypervisor based on its UUID. """ - ret = libvirtmod.virNetworkLookupByUUID(self._o, uuid) - if ret is None:raise libvirtError('virNetworkLookupByUUID() failed', net=self) - __tmp = virNetwork(self, _obj=ret) - return __tmp - class virInterface: def __init__(self, conn, _obj=None): self._conn = conn @@ -1689,6 +1682,13 @@ class virConnect: __tmp = virDomain(self,_obj=ret) return __tmp + def networkLookupByUUID(self, uuid): + """Try to lookup a network on the given hypervisor based on its UUID. """ + ret = libvirtmod.virNetworkLookupByUUID(self._o, uuid) + if ret is None:raise libvirtError('virNetworkLookupByUUID() failed', conn=self) + __tmp = virNetwork(self, _obj=ret) + return __tmp +
* build: consistently indent preprocessor directivesEric Blake2010-03-091-7/+7
| | | | | | | * global: patch created by running: for f in $(git ls-files '*.[ch]') ; do cppi $f > $f.t && mv $f.t $f done
* Introduce public API for domain async job handlingv0.7.7Daniel P. Berrange2010-03-025-0/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Introduce a new public API that provides a way to get progress info on currently running jobs on a virDomainpPtr. APIs that are initially within scope of this idea are virDomainMigrate virDomainMigrateToURI virDomainSave virDomainRestore virDomainCoreDump These all take a potentially long time and benefit from monitoring. The virDomainJobInfo struct allows for various pieces of information to be reported - Percentage completion - Time - Overall data - Guest memory data - Guest disk/file data * include/libvirt/libvirt.h.in: Add virDomainGetJobInfo * python/generator.py, python/libvirt-override-api.xml, python/libvirt-override.c: Override for virDomainGetJobInfo API * python/typewrappers.c, python/typewrappers.h: Introduce wrapper for unsigned long long type
* python: Actually add virConnectGetVersion to generated bindingsCole Robinson2010-02-171-1/+0
| | | | | | The recent commit to implement a python version of this function didn't drop an explicit 'ignore' check in the generator, so this never ended up in the bindings.
* libvirt-override.c: avoid a leak upon call with invalid argumentJim Meyering2010-02-161-2/+4
| | | | | * python/libvirt-override.c (libvirt_virConnectBaselineCPU): Don't leak the xmlcpus buffer upon encountering a non-string list element.
* virConnectBaselineCPU public APIJiri Denemark2010-02-123-0/+60
|
* Add virConnectGetVersion Python APIv0.7.6Taizo ITO2010-01-223-0/+33
| | | | | | | | | adds a new python API call for retrieving the running hypervisor version used by a connection: virConnectGetVersion * python/generator.py: skip virConnectGetVersion from autogenerated * python/libvirt-override-api.xml python/libvirt-override.c: define direct native bindings
* gnulib added a new syntax-check test: use $(VAR), not @VAR@Jim Meyering2010-01-182-6/+6
| | | | | | | | | | | | | | | The latter is not officially "wrong", but *is* terribly anachronistic. I think automake documentation or comments call that syntax obsolescent. * cfg.mk (_makefile_at_at_check_exceptions): Exempt @SCHEMADIR@ and @SYSCONFDIR@ uses -- there are no Makefile variables for those. * docs/Makefile.am: Use $(INSTALL), not @INSTALL@. * examples/dominfo/Makefile.am: Similar. * examples/domsuspend/Makefile.am: Similar. * proxy/Makefile.am: Similar. * python/Makefile.am: Similar. * python/tests/Makefile.am: Similar. * src/Makefile.am: Similar. * tests/Makefile.am: Similar.
* Disable building of static Python moduleDiego Elio Pettenò2010-01-061-1/+1
| | | | | * python/Makefile.am: python modules are loaded at runtime so the static version is not needed, avoid building it
* python: Add python bindings for virDomainMemoryStatsv0.7.5Adam Litke2009-12-203-2/+50
| | | | | | | | | | | | Enable virDomainMemoryStats in the python API. dom.memoryStats() will return a dictionary containing the supported statistics. A dictionary is required because the meaining of each quantity cannot be inferred from its index in a list. * python/generator.py: reenable bindings for this entry point * python/libvirt-override-api.xml python/libvirt-override.c: the generator can't handle this new function, add the new binding, and the XML description
* Add new API virDomainMemoryStats to header and driversAdam Litke2009-12-201-1/+3
| | | | | | | | | | | | Set up the types for the domainMemoryStats function and insert it into the virDriver structure definition. Because of static initializers, update every driver and set the new field to NULL. * include/libvirt/libvirt.h.in: new API * src/driver.h src/*/*_driver.c src/vbox/vbox_tmpl.c: add the new entry to the driver structure * python/generator.py: fix compiler errors, the actual python binding is implemented later
* Fix install location for Python bindingsMatthias Bolte2009-12-141-4/+4
| | | | | | | | | | | | | | | | | | | | | | Commit 66137344feb488ea87b0d92f3c03844d9a7a7786 changed the Python detection mechanism in configure to use AM_PATH_PYTHON. This results in a changed install location for the Python bindings, at least on Fedora 12 64bit systems. Before this commit libvirt.py and libvirtmod.so were installed to /usr/lib64/python2.6/site-packages After this commit they are installed to /usr/lib/python2.6/site-packages Mixed Python packages (containing *.py and *.so files) should be installed to the pyexecdir directory detected by AM_PATH_PYTHON. This restores the install location from before the AM_PATH_PYTHON commit. * configure.in: remove unnecessary pythondir export * python/Makefile.am: switch from pythondir to pyexecdir
* Use AM_PATH_PYTHON and python-config to detect Python configurationMatthias Bolte2009-12-081-1/+1
| | | | | | | | | | | | | | | | Using AM_PATH_PYTHON solves the site-packages directory problem. At least in Ubuntu with Python 2.6 and later site-packages is renamed to dist-packages and site-packages is not part of sys.path anymore. So installing the libvirt Python bindings to site-packages renders them unusable, because they can be imported from there without manually including site-packages into sys.path. AM_PATH_PYTHON detects the correct site-packages/dist-packages directory. python-config --includes gives the correct include path for the Python header files. The old probing code stays there as fallback mechanism. * configure.in: use AM_PATH_PYTHON and python-config * python/Makefile.am: remove -I because PYTHON_INCLUDES contains it now
* Fix threading problems in python bindingsDaniel P. Berrange2009-11-261-11/+100
| | | | | | | * libvirt-override.c: Add many missing calls to allow threading when entering C code, otherwise python blocks & then deadlocks when we have an async event to dispatch back into python code. Fix return value check for virDomainPinVcpu binding.
* 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>