| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
| |
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
| |
Predefine hints for all parameters possible to avoid wrong type
convert.
Signed-off-by: Edgar Kaziakhmedov <edgar.kaziakhmedov@virtuozzo.com>
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
| |
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
|
|
|
|
| |
Add override code for virDomainMigrateGetMaxDowntime
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
| |
Unfortunately python doesn't generate those.
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
| |
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
|
|
|
|
| |
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
|
|
|
|
| |
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
| |
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>
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
| |
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
|
|
|
|
| |
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
| |
Code matches the network event API implementation
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
| |
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
| |
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
| |
Format string uses 'i' for int type and 'I' for unsigned int type.
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
|
|
|
|
| |
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
|
|
|
|
| |
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
| |
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
|
|
|
|
| |
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
|
|
|
|
| |
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
|
|
|
|
|
|
| |
This removes several code duplicates and also some unusual code structures.
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
|
|
|
|
| |
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
| |
If the function fails, we need to cleanup memory and return NULL.
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
|
|
|
|
| |
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
| |
This is a recommended work-flow for allocation failures and we should
follow it.
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
|
|
|
|
|
|
|
|
| |
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>
|