summaryrefslogtreecommitdiff
path: root/libvirt-override-virConnect.py
Commit message (Collapse)AuthorAgeFilesLines
* Add support for domain event for memory device size changev7.9.0Daniel P. Berrangé2021-10-081-0/+9
| | | | Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
* Add support for memory failure event callbacksDaniel P. Berrangé2020-11-121-0/+9
| | | | Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
* connect: Just clear all event handlersPhilipp Hahn2020-08-181-2/+1
| | | | Signed-off-by: Philipp Hahn <hahn@univention.de>
* stream: Return None from callbackPhilipp Hahn2020-08-181-2/+0
| | | | | | nobody evaluates the return value. Signed-off-by: Philipp Hahn <hahn@univention.de>
* override: Convert to list comprehensionPhilipp Hahn2020-08-181-52/+10
| | | | | | :%s/retlist = list()\n\s*\(for \w\+ in ret\):\n\s*retlist.append(\(.*\))\n\n\s*return retlist/return [\2 \1]/ Signed-off-by: Philipp Hahn <hahn@univention.de>
* override: Add manual PEP 484 type annotationsPhilipp Hahn2020-08-181-71/+66
| | | | Signed-off-by: Philipp Hahn <hahn@univention.de>
* Remove legacy libvirtError argumentsPhilipp Hahn2020-08-061-26/+26
| | | | | | | | | | | | The fields have been deprecated in C with git:f60dc0bc09f09c6817d6706a9edb1579a3e2b2b8 They are only passed to the libvirtError constructor, but not stored for later or used anywhere else. sed -ri '/raise libvirtError/s/, \w+=self(\._dom)?//' *.py Signed-off-by: Philipp Hahn <hahn@univention.de>
* Normalize white spacePhilipp Hahn2020-08-061-36/+44
| | | | | | | indent by 4 spaces one spaces around assignments Signed-off-by: Philipp Hahn <hahn@univention.de>
* Add support for nwfilter binding objects / apisDaniel P. Berrangé2018-06-281-0/+12
| | | | Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
* Allow virConnect to be used as a context managerMarc Hartmayer2018-05-161-0/+6
| | | | | | | | | | | | | | | | | | The libvirt python bindings are now more 'pythonic' as virConnect can now be used as a context manager. For example, it's possible to write the following code: with libvirt.open() as conn: # do something with the connection... print(conn.listAllDomains()) At the end of this with-block the connection will be closed automatically. Signed-off-by: Marc Hartmayer <mhartmay@linux.vnet.ibm.com> Reviewed-by: Bjoern Walk <bwalk@linux.vnet.ibm.com> Reviewed-by: Boris Fiuczynski <fiuczy@linux.vnet.ibm.com>
* event: Add handler for block threshold eventPeter Krempa2017-03-291-0/+9
| | | | Unfortunately python doesn't generate those.
* event: fix comment for _dispatchDomainEventMetadataChangeCallbackPeter Krempa2017-03-291-1/+1
| | | | The comment was copied from the device removal failed event.
* Fix typos in previous secrets event patchDaniel P. Berrange2017-01-101-7/+7
| | | | Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
* Add support for domain metadata change eventDaniel P. Berrange2017-01-091-0/+9
| | | | Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
* Add support for secret event APIsDaniel P. Berrange2017-01-091-0/+43
| | | | Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
* Add support for node device update callbackJovanka Gulicoska2016-08-171-0/+10
|
* Python binding for node poll lifecycle events APIJovanka Gulicoska2016-08-021-0/+35
|
* Add support for storage pool refesh callbackv2.0.0Daniel P. Berrange2016-06-241-0/+10
| | | | Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
* Python binding for storage pool lifecycle events APIJovanka Gulicoska2016-06-161-0/+35
| | | | Code matches the network event API implementation
* event: Add support VIR_DOMAIN_EVENT_ID_DEVICE_REMOVAL_FAILEDPeter Krempa2016-04-181-0/+9
|
* Add support for JOB_COMPLETED eventJiri Denemark2016-03-081-0/+9
| | | | Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
* Add support for MIGRATION_ITERATION eventJiri Denemark2016-01-181-0/+9
| | | | Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
* Implement the DEVICE_ADDED eventJán Tomko2015-04-151-0/+9
|
* event: Add bindings for agent lifecycle eventPeter Krempa2014-11-241-0/+10
| | | | Also add the example.
* implement new tunable eventv1.2.9Pavel Hrdina2014-09-301-0/+9
| | | | | | Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1147639 Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
* API: Implement bindings for virDomainListGetStatsPavel Hrdina2014-09-011-0/+47
| | | | | | | | Implement the function by returning a list of tuples instead the array of virDomainStatsRecords and store the typed parameters as dict. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
* API: Implement bindings for virConnectGetAllDomainStatsPeter Krempa2014-09-011-0/+53
| | | | | | | | Implement the function by returning a list of tuples instead the array of virDomainStatsRecords and store the typed parameters as dict. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
* blockjob: support new BLOCK_JOB_2 eventEric Blake2014-06-181-3/+3
| | | | | | | | | | | | | | | | | Libvirt 1.2.6 is introducing a new block job event that passes disk information by target device rather than host file name. At the python level, we are just a passthrough, so we can reuse all the existing code and just wire up the new enum value. * libvirt-override-virConnect.py (_dispatchDomainEventBlockPullCallback): Rename... (_dispatchDomainEventBlockJobCallback): ...to this, and make generic to both events. * libvirt-override.c (libvirt_virConnectDomainEventBlockJobCallback): Match naming. (libvirt_virConnectDomainEventRegisterAny): Allow new registration. Signed-off-by: Eric Blake <eblake@redhat.com>
* Added python binding for the new network events APICédric Bosdonnat2013-12-111-0/+34
| | | | | | | The new network events code requires manual binding code to be written. Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
* Fix use of virDomainEventRegister in python bindingsDaniel P. Berrange2013-12-041-1/+1
| | | | | | | | | | | | | | | | | | | If an app used the virDomainEventRegister binding instead of the virDomainEventRegisterAny binding, it would never have its callback invoked. This is because the code for dispatching from the C libvirt_virConnectDomainEventCallback method was totally fubar. If DEBUG macro was set in the python build the error would become visible "libvirt_virConnectDomainEventCallback dom_class is not a class!" The code in libvirt_virConnectDomainEventCallback was inexplicably complex and has apparently never worked. The fix is to write it the same way as the other callback handlers. Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
* Make block pull event dispatcher privateDaniel P. Berrange2013-11-271-1/+1
| | | | | | | | | | | The method dispatchDomainEventBlockPullCallback which is used internally to dispatch block pull events to the python application code was missing the leading '_', to denote that it was private. All other event callback helpers have a leading '_'. No application should have been using this so it is justifiable to rename it. Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
* Test for object identity when checking for None in PythonClaudio Bley2013-08-231-1/+1
| | | | | | | | | Consistently use "is" or "is not" to compare variables to None, because doing so is preferrable, as per PEP 8 (http://www.python.org/dev/peps/pep-0008/#programming-recommendations): > Comparisons to singletons like None should always be done with is or > is not, never the equality operators.
* Add VIR_DOMAIN_EVENT_ID_DEVICE_REMOVED eventJiri Denemark2013-07-181-0/+9
|
* Introduce new domain create APIs to pass pre-opened FDs to LXCDaniel P. Berrange2013-07-181-0/+30
| | | | | | | | | | | | | | | | | | | | With container based virt, it is useful to be able to pass pre-opened file descriptors to the container init process. This allows for containers to be auto-activated from incoming socket connections, passing the active socket into the container. To do this, introduce a pair of new APIs, virDomainCreateXMLWithFiles and virDomainCreateWithFiles, which accept an array of file descriptors. For the LXC driver, UNIX file descriptor passing will be used to send them to libvirtd, which will them pass them down to libvirt_lxc, which will then pass them to the container init process. This will only be implemented for LXC right now, but the design is generic enough it could work with other hypervisors, hence I suggest adding this to libvirt.so, rather than libvirt-lxc.so Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
* python: treat flags as default argument with value 0Guannan Ren2013-03-221-7/+7
| | | | | | | | | | | The following four functions have not changed because default arguments have to come after positional arguments. Changing them will break the the binding APIs. migrate(self, dconn, flags, dname, uri, bandwidth): migrate2(self, dconn, dxml, flags, dname, uri, bandwidth): migrateToURI(self, duri, flags, dname, bandwidth): migrateToURI2(self, dconnuri, miguri, dxml, flags, dname, bandwidth):
* Remove more trailing semicolons in Python filesGuido Günther2013-02-071-5/+5
|
* Bind connection close callback APIs to python bindingDaniel P. Berrange2012-12-041-0/+23
| | | | | | | | | Add code in the python binding to cope with the new APIs virConnectRegisterCloseCallback and virConnectUnregisterCloseCallback. Also demonstrate their use in the python domain events demo Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
* Add support for SUSPEND_DISK eventMartin Kletzander2012-10-151-0/+9
| | | | | | | | | This patch adds support for SUSPEND_DISK event; both lifecycle and separated. The support is added for QEMU, machines are changed to PMSUSPENDED, but as QEMU sends SHUTDOWN afterwards, the state changes to shut-off. This and much more needs to be done in order for libvirt to work with transient devices, wake-ups etc. This patch is not aiming for that functionality.
* list: Expose virConnectListAllSecrets to Python bindingOsier Yang2012-09-171-0/+12
| | | | | | | | | | | The implementation is done manually as the generator does not support wrapping lists of C pointers into Python objects. python/libvirt-override-api.xml: Document python/libvirt-override-virConnect.py: Implementation for listAllSecrets. python/libvirt-override.c: Implementation for the wrapper.
* list: Expose virConnectListAllNWFilters to Python bindingOsier Yang2012-09-171-0/+12
| | | | | | | | | | | | The implementation is done manually as the generator does not support wrapping lists of C pointers into Python objects. python/libvirt-override-api.xml: Document python/libvirt-override-virConnect.py: * Implementation for listAllNWFilters. python/libvirt-override.c: Implementation for the wrapper.
* list: Expose virConnectListAllNodeDevices to Python bindingOsier Yang2012-09-171-0/+12
| | | | | | | | | | | | The implementation is done manually as the generator does not support wrapping lists of C pointers into Python objects. python/libvirt-override-api.xml: Document python/libvirt-override-virConnect.py: * Implementation for listAllNodeDevices. python/libvirt-override.c: Implementation for the wrapper.
* list: Expose virConnectListAllInterfaces to Python bindingCVE-2012-4423Osier Yang2012-09-121-0/+12
| | | | | | | | | | | | The implementation is done manually as the generator does not support wrapping lists of C pointers into Python objects. python/libvirt-override-api.xml: Document python/libvirt-override-virConnect.py: * New file, includes implementation of listAllInterfaces. python/libvirt-override.c: Implementation for the wrapper.
* list: Expose virConnectListAllNetworks to Python bindingOsier Yang2012-09-111-0/+12
| | | | | | | | | | | The implementation is done manually as the generator does not support wrapping lists of C pointers into Python objects. python/libvirt-override-api.xml: Document python/libvirt-override-virConnect.py: Implement listAllNetworks. python/libvirt-override.c: Implementation for the wrapper.
* python: Expose virStorageListAllStoragePools to python bindingOsier Yang2012-09-061-0/+12
| | | | | | | | | The implementation is done manually as the generator does not support wrapping lists of C pointers into Python objects. python/libvirt-override-api.xml: Document python/libvirt-override-virConnect.py: Add listAllStoragePools python/libvirt-override.c: Implementation for the wrapper.
* Define public API for receiving guest memory balloon eventsDaniel P. Berrange2012-07-141-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | When the guest changes its memory balloon applications may want to know what the new value is, without having to periodically poll on XML / domain info. Introduce a "balloon change" event to let apps see this * include/libvirt/libvirt.h.in: Define the virConnectDomainEventBalloonChangeCallback callback and VIR_DOMAIN_EVENT_ID_BALLOON_CHANGE constant * python/libvirt-override-virConnect.py, python/libvirt-override.c: Wire up helpers for new event * daemon/remote.c: Helper for serializing balloon event * examples/domain-events/events-c/event-test.c, examples/domain-events/events-python/event-test.py: Add example of balloon event usage * src/conf/domain_event.c, src/conf/domain_event.h: Handling of balloon events * src/remote/remote_driver.c: Add handler of balloon events * src/remote/remote_protocol.x: Define wire protocol for balloon events * src/remote_protocol-structs: Likewise. Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
* python: add API exports for virConnectListAllDomains()Peter Krempa2012-06-181-0/+12
| | | | | | | | | | | This patch adds export of the new API function virConnectListAllDomains() to the libvirt-python bindings. The virConnect object now has method "listAllDomains" that takes only the flags parameter and returns a python list of virDomain object corresponding to virDomainPtrs returned by the underlying api. The implementation is done manually as the generator does not support wrapping list of virDomainPtrs into virDomain objects.
* Add support for the suspend eventv0.9.11-rc1Osier Yang2012-03-231-0/+9
| | | | | | | | | | | | | | | | | | This patch introduces a new event type for the QMP event SUSPEND: VIR_DOMAIN_EVENT_ID_PMSUSPEND The event doesn't take any data, but considering there might be reason for wakeup in future, the callback definition is: typedef void (*virConnectDomainEventSuspendCallback)(virConnectPtr conn, virDomainPtr dom, int reason, void *opaque); "reason" is unused currently, always passes "0".
* Add support for the wakeup eventOsier Yang2012-03-231-0/+8
| | | | | | | | | | | | | | | | | | This patch introduces a new event type for the QMP event WAKEUP: VIR_DOMAIN_EVENT_ID_PMWAKEUP The event doesn't take any data, but considering there might be reason for wakeup in future, the callback definition is: typedef void (*virConnectDomainEventWakeupCallback)(virConnectPtr conn, virDomainPtr dom, int reason, void *opaque); "reason" is unused currently, always passes "0".
* Add support for event tray moved of removable disksOsier Yang2012-03-231-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch introduces a new event type for the QMP event DEVICE_TRAY_MOVED, which occurs when the tray of a removable disk is moved (i.e opened or closed): VIR_DOMAIN_EVENT_ID_TRAY_CHANGE The event's data includes the device alias and the reason for tray status' changing, which indicates why the tray status was changed. Thus the callback definition for the event is: enum { VIR_DOMAIN_EVENT_TRAY_CHANGE_OPEN = 0, VIR_DOMAIN_EVENT_TRAY_CHANGE_CLOSE, \#ifdef VIR_ENUM_SENTINELS VIR_DOMAIN_EVENT_TRAY_CHANGE_LAST \#endif } virDomainEventTrayChangeReason; typedef void (*virConnectDomainEventTrayChangeCallback)(virConnectPtr conn, virDomainPtr dom, const char *devAlias, int reason, void *opaque);
* startupPolicy: Emit event on disk source droppingv0.9.7-rc1Michal Privoznik2011-10-251-0/+9
| | | | | | | | | | 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);