summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* virStream: Introduce virStreamSparse{Recv,Send}AllMichal Privoznik2017-05-243-2/+109
| | | | | | | Yet again, our parser is not capable of generating proper wrapper. To be fair, this one wold be really tough anyway. Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
* virStream: Introduce virStreamRecvFlagsMichal Privoznik2017-05-233-0/+58
| | | | | | | 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-233-0/+86
| | | | | | | | 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>
* Use better comparison in virStream.sendAll for Python 3Xavier Fernandez2017-05-171-1/+1
| | | | | In Python 3, if the file is open in binary mode, @got will end up being equal to b"" and b"" != "" in Python 3.
* spec: Install egg-info with rpm packageMartin Kletzander2017-05-151-1/+2
| | | | | | | | This was being done due to now deprecated policy and that file should be installed so that pip can recognize that the packages is already installed in the system. Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
* Release of libvirt-python-3.3.0v3.3.0Daniel Veillard2017-05-051-1/+1
|
* event-test: add ability to run the asyncio event loopDaniel P. Berrange2017-04-041-15/+35
| | | | | | | The event test program '--loop' arg is modified to take the name of an event loop impl to run. eg 'event-test.py --loop asyncio' Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
* event-test: rename example event loop implDaniel P. Berrange2017-04-041-15/+15
| | | | | | | Use the name 'Poll' instead of 'Pure' for the event loop demo, since there's now a second pure python loop impl available. Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
* event-test: unregister callbacks & close conn on exitDaniel P. Berrange2017-04-041-36/+59
| | | | | | | | | In order to test cleanup code paths we must unregister all callbacks and close the connection on shutdown. Since cleanup happens in the background, we do a short sleep to allow the main loop to run its cleanup too. Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
* event-test: add timeout to exit event loopDaniel P. Berrange2017-04-041-2/+8
| | | | Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
* event-test: free opaque data when removing callbacksDaniel P. Berrange2017-04-041-1/+10
| | | | | | | | | | The pure python event loop impl has to call libvirt.virEventInvokeFreeCallback to free the event opaque data from a clean stack context Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
* Add asyncio event loop implementationWojtek Porczyk2017-04-044-0/+414
| | | | | | | | | | | | | | This is usable only on python >= 3.4 (or 3.3 with out-of-tree asyncio), however it should be harmless for anyone with older python versions. In simplest case, to have the callbacks queued on the default loop: >>> import libvirtaio >>> libvirtaio.virEventRegisterAsyncIOImpl() The function is not present on non-compatible platforms. Signed-off-by: Wojtek Porczyk <woju@invisiblethingslab.com>
* Allow for ff callbacks to be called by custom event implementationsWojtek Porczyk2017-04-043-31/+63
| | | | | | | | | | | | | | | 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>
* Release of libvirt-python-3.2.0v3.2.0Daniel Veillard2017-04-021-1/+1
| | | | * setup.py: bumped version
* event: Add handler for block threshold eventPeter Krempa2017-03-293-0/+75
| | | | 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.
* Removed unused 'functions_list_exception_test' code from generatorv3.1.0Daniel P. Berrange2017-01-271-21/+8
| | | | | | | | The 'functions_list_exception_test' data structure and associated code in the generator is inherited from libxml. This has never been used in libvirt, so delete it to simplify the generator. Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
* Removed unused 'converter_type' code from generatorDaniel P. Berrange2017-01-271-15/+0
| | | | | | | | The 'converter_type' data structure and associated code in the generator is inherited from libxml. This has never been used in libvirt, so delete it to simplify the generator. Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
* Removed unused 'classes_ancestor' code from generatorDaniel P. Berrange2017-01-271-34/+22
| | | | | | | | The 'classes_ancestor' data structure and associated code in the generator is inherited from libxml. This has never been used in libvirt, so delete it to simplify the generator. Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
* Removed unused 'py_return_types' code from generatorDaniel P. Berrange2017-01-271-13/+0
| | | | | | | | The 'py_return_types' data structure and associated code in the generator is inherited from libxml. This has never been used in libvirt, so delete it to simplify the generator. Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
* Removed unused 'foreign_encoding_args' code from generatorDaniel P. Berrange2017-01-271-5/+0
| | | | | | | | The 'foreign_encoding_args' data structure and associated code in the generator is inherited from libxml. This has never been used in libvirt, so delete it to simplify the generator. Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
* Removed unused 'function_post' code from generatorDaniel P. Berrange2017-01-271-28/+0
| | | | | | | | The 'function_post' data structure and associated code in the generator is inherited from libxml. This has never been used in libvirt, so delete it to simplify the generator. Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
* Removed unused 'reference_keepers' code from generatorDaniel P. Berrange2017-01-271-24/+0
| | | | | | | | The 'reference_keepers' data structure and associated code in the generator is inherited from libxml. This has never been used in libvirt, so delete it to simplify the generator. Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
* Protect against user accidentally calling constructors directlyDaniel P. Berrange2017-01-271-0/+2
| | | | | | | | | | | | | | | | | | | | | When using libvirt python you must never call the object constructors directly, as these are expecting to be passed a wrapped C object. For example import libvirt c = libvirt.virConnect("qemu:///system") c.listAllDomains() will mysteriously segfault. With this change the user now gets an slightly more helpful error Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/berrange/src/virt/libvirt-python/build/libvirt.py", line 3409, in __init__ raise Exception("Expected a wrapped C Object but got %s" % type(_obj)) Exception: Expected a wrapped C Object but got <type 'str'> Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
* 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>
* Post-release version bump to 3.1.0John Ferlan2017-01-181-1/+1
|
* Release of libvirt-python-3.0.0v3.0.0Daniel Veillard2017-01-171-1/+1
|
* examples: Update event-test.pyMichal Privoznik2017-01-101-0/+24
| | | | | | | With recent changes there are new events known to libvirt. Reflect those changes in our event-test.py example script. Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
* 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-092-0/+66
| | | | Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
* Add support for secret event APIsDaniel P. Berrange2017-01-094-0/+251
| | | | Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
* Add override impl for virStorageVolGetInfoFlagsDaniel P. Berrange2016-12-213-0/+50
| | | | Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
* Remove bogus \o escape in regexDaniel P. Berrange2016-12-211-1/+1
| | | | | | | | One of the regexes has a bogus \o instead of plain 'o'. Somehow this magically worked on all versions of python, until 3.6 came along and complained Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
* Fix running of nosetests on python 3Daniel P. Berrange2016-12-141-1/+16
| | | | | | | | | | Previously the way Fedora installed /usr/bin/nosetests allowed it to be invoked with either python 2 or 3. Since Fedora 25 though, it contains a module name that only exists on python 2. So we need to be more intelligent and pick a different nosetests binary per version. Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
* HACKING: fix grammarPrabodh Agarwal2016-12-131-1/+1
|
* Fill out more fields for PKG-INFO fileDaniel P. Berrange2016-12-051-1/+7
| | | | | | | Ensure the description and license are set in PKG-INFO, and clarify the summary field. Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
* don't overrun buffer when converting cpumapv2.5.0Konstantin Neumoin2016-11-111-6/+1
| | | | | | | | | | | If we pass large(more than cpunum) cpu mask to any libvirt_virDomainPin* function, it could leads to crash. So we have to check tuple size in virPyCpumapConvert and ignore extra tuple members. Since we allocate a zeroed buffer, we don't need to bother with setting the bits to zero. Signed-off-by: Konstantin Neumoin <kneumoin@virtuozzo.com>
* move cpumap conversion code to a common helperKonstantin Neumoin2016-11-113-120/+73
| | | | | | | | 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>
* Post-release version bump to 2.5.0Pavel Hrdina2016-11-021-1/+1
| | | | Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
* Release of libvirt-2.4.0v2.4.0Daniel Veillard2016-11-011-1/+1
| | | | * setup.py: just bumped up the release number
* override: Properly override wrapper for virDomainGetGuestVcpusv2.3.0Peter Krempa2016-09-191-0/+6
| | | | | | | | | | | | | | | | | | Without the change to libvirt-override-api.xml generator.py would generate the following function header: def guestVcpus(self, params, nparams, flags=0): Since @params and @nparams are output-only in C and the python C implementation actualy creates a dict from them we should not need to pass them. Add the API definition to drop the two unnecessary args: def guestVcpus(self, flags=0): The code did not work at all until this change as the C impl expects only two arguments but the python required use of four. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1377071
* Post-release version bump to 2.3.0Peter Krempa2016-09-191-1/+1
|
* PyArg_ParseTuple: Provide correct function namesv2.2.0Michal Privoznik2016-08-242-13/+14
| | | | | | | | | | 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>
* event-test: support node device update callbackJovanka Gulicoska2016-08-171-0/+4
|
* Add support for node device update callbackJovanka Gulicoska2016-08-172-0/+64
|
* event-test: Add node device lifecycle event testsJovanka Gulicoska2016-08-021-0/+16
|
* Python binding for node poll lifecycle events APIJovanka Gulicoska2016-08-024-0/+193
|
* Post-release version bump to 2.2.0Cole Robinson2016-08-021-1/+1
|
* allow pkg-config binary to be set by envv2.1.0Markus Rothe2016-07-281-0/+2
| | | | https://bugzilla.redhat.com/show_bug.cgi?id=1350523
* Post-release version bump to 2.1.0Pavel Hrdina2016-07-251-1/+1
| | | | Signed-off-by: Pavel Hrdina <phrdina@redhat.com>