summaryrefslogtreecommitdiff
path: root/libvirt-override.c
Commit message (Collapse)AuthorAgeFilesLines
...
* Add missing virPyDictToTypedParams hint for migration paramsPavel Hrdina2018-02-191-0/+1
| | | | | Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
* Fix order of virPyDictToTypedParams hintsPavel Hrdina2018-02-191-3/+3
| | | | | | | This corresponds to the order in libvirt-domain.h header file. Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
* Use static variables to store virPyDictToTypedParams hintsPavel Hrdina2018-02-191-117/+32
| | | | | | | | There is no need to have dynamic allocation every time the API is called. Rewrites commit <314b2346df>. Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
* Set hints for virPyDictToTypedParamsEdgar Kaziakhmedov2018-02-191-4/+124
| | | | | | | Predefine hints for all parameters possible to avoid wrong type convert. Signed-off-by: Edgar Kaziakhmedov <edgar.kaziakhmedov@virtuozzo.com>
* libvirt-python : PyObject memory leakPeng Hao2017-12-111-1/+1
| | | | | | | libvirt_virConnectDomainEventTunableCallback leak a PyObject. Signed-off-by: Peng Hao <peng.hao2@zte.com.cn> Signed-off-by: Wang Yechao <wang.yechao255@zte.com.cn>
* Unify whitespace around *_ALLOW_THREADS macrosv3.8.0Nir Soffer2017-09-291-28/+87
| | | | | | | Most of the code treats libvirt API calls as separate block, keeping one blank line before the LIBVIRT_BEGIN_ALLOW_THREAD, and one blank line after LIBVIRT_END_ALLOW_THREADS. Unify the whitespace so all calls wrapped with these macros are treated as a separate block.
* Release the GIL during virDomainGetMemoryStats & virDomainGetDiskErrorsNir Soffer2017-09-271-1/+8
| | | | | | | | | | | | We discovered that the entire python process get stuck for about 30 seconds when calling virDomain.getMemoryStats() if libvirt is stuck in virConnect.getAllDomainStats() on inaccessible storage. This blocking cause a horrible mess in oVirt. This patches adds the standard *_ALLOW_THREADS around the call to avoid this unwanted blocking. Signed-off-by: Nir Soffer <nirsof@gmail.com>
* Fix comparisons between signed & unsigned integersDaniel P. Berrange2017-09-261-54/+54
| | | | | | | | | When python3 builds C modules, it adds the -Wsign-compare flag to GCC. This creates lots of warnings where we compare a 'size_t' value against an 'int' value due to signed/unsigned difference. Change all the size_t types to ssize_t to address this. Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
* Report an error if registering an event loop twiceDaniel P. Berrange2017-09-061-7/+6
| | | | | | | | | The C library will now ignore an attempt to register an event loop twice. It is unable to report an error in this case though due to the C API returning 'void'. To improve this we must manually report an error at the python level. Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
* Remove unused variables for event callbacksDaniel P. Berrange2017-09-061-22/+0
| | | | Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
* Implement virDomainMigrateGetMaxDowntimeJohn Ferlan2017-08-261-0/+33
| | | | Add override code for virDomainMigrateGetMaxDowntime
* virDomainMemoryStats: include usable memory and last updateTomáš Golembiovský2017-08-021-0/+8
| | | | | | | | We've forgot to include VIR_DOMAIN_MEMORY_STAT_USABLE and VIR_DOMAIN_MEMORY_STAT_LAST_UPDATE constants. Signed-off-by: Tomáš Golembiovský <tgolembi@redhat.com> Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
* virStream: Introduce virStreamRecvFlagsMichal Privoznik2017-05-231-0/+39
| | | | | | | Yet again, we need a custom wrapper over virStreamRecvFlags because our generator is not capable of generating it. Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
* Implement virStreamSendHole/virStreamRecvHoleMichal Privoznik2017-05-231-0/+63
| | | | | | | | The return value for virStreamRecvHole is slightly different to its C counterpart. In python, either it returns the hole size or None if C API fails. Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
* Allow for ff callbacks to be called by custom event implementationsWojtek Porczyk2017-04-041-30/+38
| | | | | | | | | | | | | | | The documentation says: > If the opaque user data requires free'ing when the handle is > unregistered, then a 2nd callback can be supplied for this purpose. > This callback needs to be invoked from a clean stack. If 'ff' > callbacks are invoked directly from the virEventRemoveHandleFunc they > will likely deadlock in libvirt. And they did deadlock. In removeTimeout too. Now we supply a custom function to pick it from the opaque blob and fire. Signed-off-by: Wojtek Porczyk <woju@invisiblethingslab.com> Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
* event: Add handler for block threshold eventPeter Krempa2017-03-291-0/+62
| | | | Unfortunately python doesn't generate those.
* Fix the incorrect memory freeing which will result in crashWu Zongyong2017-01-181-4/+4
| | | | | | | | | Commit id '71fd95409' neglected to adjust a couple of API's do that now. The number of elements in new_params is equal to the length of info, instead of nparams, so it's wrong to free new_params using nparams. Signed-off-by: Wu Zongyong <wuzongyo@mail.ustc.edu.cn>
* Add support for domain metadata change eventDaniel P. Berrange2017-01-091-0/+57
| | | | Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
* Add support for secret event APIsDaniel P. Berrange2017-01-091-0/+203
| | | | Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
* Add override impl for virStorageVolGetInfoFlagsDaniel P. Berrange2016-12-211-0/+43
| | | | Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
* move cpumap conversion code to a common helperKonstantin Neumoin2016-11-111-120/+11
| | | | | | | | All libvirt_virDomainPin* functions do the same thing for convert pycpumap to cpumap, so this patch moves all common logic to new helper - virPyCpumapConvert. Signed-off-by: Konstantin Neumoin <kneumoin@virtuozzo.com>
* PyArg_ParseTuple: Provide correct function namesv2.2.0Michal Privoznik2016-08-241-12/+12
| | | | | | | | | | At the end of the format string we put :virFunctionName where ':' says "this is the end of argument list", and virFunctionName is the prefix for error messages then. However, in some cases we have had wrong names there. Some of them are actually quite funny: xmlRegisterErrorHandler. Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
* Add support for node device update callbackJovanka Gulicoska2016-08-171-0/+54
|
* Python binding for node poll lifecycle events APIJovanka Gulicoska2016-08-021-0/+153
|
* Fix crash in storage pool refresh callbackPavel Hrdina2016-07-231-1/+1
| | | | | | | | Fixes copy-paste typo introduced by commit cb84e36c. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1354271 Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
* Add support for storage pool refesh callbackv2.0.0Daniel P. Berrange2016-06-241-1/+55
| | | | Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
* Fix signedness of arg to virDomainGetGuestVcpusDaniel P. Berrange2016-06-241-1/+1
| | | | Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
* Add support for virDomainGetGuestVcpusMichal Privoznik2016-06-231-0/+33
| | | | | | | | This function has virTypedParameterPtr as one of the args and our generator is unable to deal with that. Therefore we must provide implementation. Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
* Python binding for storage pool lifecycle events APIJovanka Gulicoska2016-06-161-0/+153
| | | | Code matches the network event API implementation
* fix crash in getAllDomainStatsPavel Hrdina2016-04-181-1/+7
| | | | | | | | | | | Commits 1d39dbaf and 827ed9b4 broke the libvirt-python API by removing virDomainRef() and virDomainFree(). virDomainStatsRecordListFree() will free that domain pointer and later when virDomain (python object) call its destructor and tries to free that same pointer again. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1326839 Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
* event: Add support VIR_DOMAIN_EVENT_ID_DEVICE_REMOVAL_FAILEDPeter Krempa2016-04-181-0/+60
|
* python: add python binding for Perf APIQiaowei Ren2016-03-311-0/+100
| | | | | | | | This patch adds the python binding for virDomainSetPerfEvents and virDomainSetPerfEvents API. Signed-off-by: Qiaowei Ren <qiaowei.ren@intel.com> Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
* Add support for JOB_COMPLETED eventJiri Denemark2016-03-081-0/+64
| | | | Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
* libvirt-override: fix PyArg_ParseTuple for size_tv1.3.2Pavel Hrdina2016-02-231-2/+2
| | | | | | | Format string uses 'n' for Py_ssize_t but size_t is unsigned long, we need to use 'k'. Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
* libvirt-override: fix PyArg_ParseTuple for unsigned long longPavel Hrdina2016-02-231-2/+2
| | | | | | | | | Format string uses 'L' for long long type and 'K' for unsigned long long type. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1260356 Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
* libvirt-override: fix PyArg_ParseTuple for unsigned intPavel Hrdina2016-02-231-6/+6
| | | | | | Format string uses 'i' for int type and 'I' for unsigned int type. Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
* libvirt-override: all flags should be defined as unsigned intPavel Hrdina2016-02-231-1/+1
| | | | Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
* Add support for MIGRATION_ITERATION eventJiri Denemark2016-01-181-0/+57
| | | | Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
* fix crash introduced by commit 1d39dbafv1.2.21Pavel Hrdina2015-10-311-2/+7
| | | | | | | | | | Some of the libvirt_*Wrap functions steals the reference and we need to set the item in array to NULL no not free it on success. Those three places was accidentally removed by commit 1d39dbaf. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1270977 Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
* use VIR_PY_DICT_SET_GOTOPavel Hrdina2015-10-051-182/+102
| | | | Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
* use VYR_PY_LIST_SET_GOTO and VIR_PY_LIST_APPEND_GOTOPavel Hrdina2015-10-051-272/+341
| | | | Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
* use VIR_PY_TUPLE_GOTOPavel Hrdina2015-10-051-153/+155
| | | | Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
* improve usage of cleanup pathsPavel Hrdina2015-10-051-138/+126
| | | | | | This removes several code duplicates and also some unusual code structures. Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
* drop unnecessary py_retval variablePavel Hrdina2015-10-051-97/+43
| | | | Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
* change the order of some statementsPavel Hrdina2015-10-051-103/+85
| | | | | | | | | | | | This change makes it easier to free allocated object especially for python objects. We can benefit from the fact, that if you call Py_DECREF on any python object it will also remove reference for all assigned object to the root object. For example, calling Py_DECREF on dict will also remove reference recursively on all elements in that dictionary. Our job is then just call Py_DECREF on the root element and don't care about anything else. Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
* Must check return value for all Py*_New functionsPavel Hrdina2015-10-051-94/+189
| | | | | | If the function fails, we need to cleanup memory and return NULL. Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
* use Py_CLEAR instead of Py_XDECREF followed by NULL assignmentPavel Hrdina2015-10-051-46/+23
| | | | Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
* Use VIR_PY_NONE instead of increment and Py_NonePavel Hrdina2015-10-051-6/+3
| | | | | | | To insert Py_None into some other python object like dict or tuple, you need to increase reference to the Py_None. We have a macro to do that. Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
* Return NULL and set an exception if allocation failsPavel Hrdina2015-10-051-22/+31
| | | | | | | This is a recommended work-flow for allocation failures and we should follow it. Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
* Return correct python objectPavel Hrdina2015-10-051-11/+18
| | | | | | | | In case of error without setting an python exception we need to return a correct python object. For functions that returns anything else than a number the return value is 'None', otherwise it's '-1'. Signed-off-by: Pavel Hrdina <phrdina@redhat.com>