summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
* libvirt_charPtrUnwrap: remove unnecessary check of returned stringPavel Hrdina2018-06-122-15/+7
| | | | | | | | Function libvirt_charPtrUnwrap() either fails or always sets the unwrapped string so there is no need to check it explicitly. Reviewed-by: Ján Tomko <jtomko@redhat.com> Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
* libvirt-override: Reset exception if the error is ignoredPavel Hrdina2018-06-121-1/+3
| | | | | | | | In virConnectCredCallbackWrapper() we ignore the error case of libvirt_charPtrUnwrap() function so we should also reset the exception. Reviewed-by: Ján Tomko <jtomko@redhat.com> Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
* typewrappers: Fix libvirt_charPtrUnwrap to set an exception if it failsPavel Hrdina2018-06-121-1/+4
| | | | | | | If the function fails it should always set an exception. Reviewed-by: Ján Tomko <jtomko@redhat.com> Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
* libvirt-utils: remove unused py_str functionPavel Hrdina2018-06-122-15/+0
| | | | | | | | Commit <57a160b5248ba47d4e1c9d22d95847dad8e0524f> removed last usage but did not remove the function itself. Reviewed-by: Ján Tomko <jtomko@redhat.com> Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
* Blacklist virGetLastError{Code,Domain}Daniel P. Berrangé2018-06-061-1/+3
| | | | | | | These methods will not be exposed to apps, since we auto raise all errors. Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
* Release of libvirt-python-4.4.0v4.4.0Daniel Veillard2018-06-041-1/+1
| | | | | | * setup.py: update for release Signed-off-by: Daniel Veillard <veillard@redhat.com>
* Add support for virConnectBaselineHypervisorCPUJiri Denemark2018-06-013-0/+72
| | | | | | | | | | The python bindings for this API cannot be generated because are generator is not capable of handling string arrays (char **) parameters. https://bugzilla.redhat.com/show_bug.cgi?id=1584676 Signed-off-by: Jiri Denemark <jdenemar@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
* event-test.py: Sync list of storage lifecycle eventsMichal Privoznik2018-05-221-0/+2
| | | | | | | | | | | | https://bugzilla.redhat.com/show_bug.cgi?id=1578337 Since libvirt 3.8.0 we have 6 events: defined, undefined, started, stopped, created, deleted. However, the last two were missing in a string list that translates libvirt events (int) into human readable strings. Signed-off-by: Michal Privoznik <mprivozn@redhat.com> Reviewed-by: Pavel Hrdina <phrdina@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>
* libvirt-override.py: remove unused importMarc Hartmayer2018-05-161-1/+0
| | | | | | Signed-off-by: Marc Hartmayer <mhartmay@linux.vnet.ibm.com> Reviewed-by: Boris Fiuczynski <fiuczy@linux.vnet.ibm.com> Reviewed-by: Bjoern Walk <bwalk@linux.vnet.ibm.com>
* libvirt-override.py: fix sparseSendAllBoris Fiuczynski2018-05-161-1/+1
| | | | | | | Variable ret is used before assignment. Signed-off-by: Boris Fiuczynski <fiuczy@linux.vnet.ibm.com> Signed-off-by: Marc Hartmayer <mhartmay@linux.vnet.ibm.com>
* libvirt_qemu/lxc: fix a namespace issueMarc Hartmayer2018-05-161-2/+2
| | | | | | 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>
* libvirt_qemu/lxc: import 'sys' packageMarc Hartmayer2018-05-161-0/+4
| | | | | | | | | | | This fixes the pylint [1] warning "E: 25,16: Undefined variable 'sys' (undefined-variable)". [1] https://www.pylint.org/ Signed-off-by: Marc Hartmayer <mhartmay@linux.vnet.ibm.com> Reviewed-by: Boris Fiuczynski <fiuczy@linux.vnet.ibm.com> Reviewed-by: Bjoern Walk <bwalk@linux.vnet.ibm.com>
* maint: Drop autobuild.shAndrea Bolognani2018-05-031-30/+0
| | | | | | | | | | | | | | The Test-AutoBuild project, that this script is supposed to be used with, hasn't seen any activity in ~7 years; these days, libvirt-python CI builds are happening on the Jenkins-based CentOS CI environment under the libvirt umbrella[1], and in that context the script is not used at all. [1] https://ci.centos.org/view/libvirt/ Signed-off-by: Andrea Bolognani <abologna@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
* git: add config file telling git-publish how to send patchesv4.3.0Daniel P. Berrangé2018-04-241-0/+4
| | | | | | | | | | | | | | | | | | | | | | | The "git-publish" tool is a useful git extension for sending patch series for code review. It automatically creates versioned tags each time code on a branch is sent, so that there is a record of each version. It also remembers the cover letter so it does not need re-entering each time the series is reposted. With this config file present it is now sufficient[1] to run $ git publish to send all patches in a branch to the list for review, with the correct subject prefix added for this non-core libvirt module. [1] Assuming your $HOME/.gitconfig has an SMTP server listed at least e.g. [sendemail] smtpserver = smtp.example.com Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
* Fix build with older libvirt versionsDaniel P. Berrangé2018-04-191-0/+32
| | | | | | | | | | | | | | | | | | | | The libvirt python module is supposed to build with historical versions of the API back to 0.9.1, which means all constants / methods must be wrapped in conditionals. This was accidentally forgotten in: commit 314b2346df2d8e2d7d705b003c693b4fa0189bdf Author: Edgar Kaziakhmedov <edgar.kaziakhmedov@virtuozzo.com> Date: Wed Feb 7 17:49:30 2018 +0300 Set hints for virPyDictToTypedParams Predefine hints for all parameters possible to avoid wrong type convert. This broke the build against any libvirt < 2.0.0 Reviewed-by: Ján Tomko <jtomko@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
* Post-release version bump to 4.3.0Daniel P. Berrangé2018-04-031-1/+1
| | | | Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
* Disable Python 2 on future RHEL and Fedora > 29v4.2.0Daniel P. Berrangé2018-03-231-0/+4
| | | | | | | | | | | | The end of Python 2 is nearing, so declare when it will be removed from libvirt Python binding RPMs. NB, this doesn't imply we'll be removing py2 support from upstream libvirt-python on the same timeframe - we'll consider what todo wrt that when upstream Python 2 finally goes EOL. Reviewed-by: Jiri Denemark <jdenemar@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
* Post-release version bump to 4.2.0Daniel P. Berrangé2018-03-051-1/+1
| | | | Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
* Release of libvirt-python 4.1.0v4.1.0Daniel Veillard2018-03-051-1/+1
| | | | Signed-off-by: Daniel Veillard <veillard@redhat.com>
* Fix virPyDictToTypedParams type hint for block copy paramsPavel Hrdina2018-02-191-1/+1
| | | | | Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
* 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-192-117/+34
| | | | | | | | 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>
* tests: add special case for virStoragePoolLookupByTargetPathDaniel P. Berrangé2018-02-091-1/+2
| | | | | | | This new API trips up the sanity test for checking mapping of all C APIs into Python. Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
* event-test.py: Remove extra ( in --help outputJiri Denemark2018-02-061-2/+2
| | | | Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
* Release of libvirt-python-4.0.0v4.0.0Daniel Veillard2018-01-191-1/+1
|
* Use python*_sitearch macros instead of manually defining the dirDaniel P. Berrange2018-01-121-15/+15
| | | | | | | | Note we use python_sitearch not python2_sitearch, since the former is more portable. Reviewed-by: Pavel Hrdina <phrdina@redhat.com> Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
* Fix filtering of RPM provides for .so filesDaniel P. Berrange2018-01-121-0/+5
| | | | | Reviewed-by: Pavel Hrdina <phrdina@redhat.com> Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
* Require libvirt native version matching py version by defaultDaniel P. Berrange2018-01-122-3/+2
| | | | | | | | | | | | | Although we're capable of building against any libvirt >= 0.9.11, 99% of the time we want RPM builds to be done against matching libvirt version, otherwise we might silently build against an unexpected/wrong version. We don't support building against a native libvirt that's newer than the python binding, since the generator may incorrectly handle new APIs. So use == instead of >= too. Reviewed-by: Pavel Hrdina <phrdina@redhat.com> Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
* Turn on python3 sub-RPMs for RHEL > 7Daniel P. Berrange2018-01-121-1/+1
| | | | | | | | | It is expected that future RHEL-8 will have python3 by default, so enable that. It is unclear whether python2 will still be available, so leave that enabled for now. Reviewed-by: Pavel Hrdina <phrdina@redhat.com> Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
* Adapt to rename of py2 RPMs from python- to python2- prefixDaniel P. Berrange2018-01-121-0/+12
| | | | | Reviewed-by: Pavel Hrdina <phrdina@redhat.com> Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
* Add emacs mode marker to activate rpm-spec highlightingDaniel P. Berrange2018-01-121-0/+2
| | | | | Reviewed-by: Pavel Hrdina <phrdina@redhat.com> Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
* Add checks for min supported distrosDaniel P. Berrange2018-01-121-0/+16
| | | | | | | | Be clear about which distros we aim to support with the specfile, so we know what we can cleanup in the spec later. Reviewed-by: Pavel Hrdina <phrdina@redhat.com> Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
* Allow override of which sub-RPMs to buildDaniel P. Berrange2018-01-121-3/+6
| | | | | | | | | | | Allow using rpmbuild --define "with_python2 0" to override the default logic about which python sub-RPMs to build Reviewed-by: Pavel Hrdina <phrdina@redhat.com> Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
* Allow disabling of python2 RPM buildDaniel P. Berrange2018-01-121-0/+13
| | | | | | | | | | | | With Fedora modularity, it is possible to have add-on repos for multiple versions of python3. It is thus desirable to be able to build libvirt-python in these repos, with only the python3 sub-RPMs enabled. Thus also helps if future RHEL/Fedora drop python2 entirely from their default repos. Reviewed-by: Pavel Hrdina <phrdina@redhat.com> Signed-off-by: Daniel P. Berrange <berrange@redhat.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>
* Release of libvirt-python 3.10.0v3.10.0Daniel Veillard2017-12-041-1/+1
|
* Don't hardcode interpreter pathCédric Bosdonnat2017-11-304-4/+4
| | | | | | | | This is particularly useful on operating systems that don't ship Python as part of the base system (eg. FreeBSD) while still working just as well as it did before on Linux. Reviewed-by: Daniel P. Berrange <berrange@redhat.com>
* Release of libvirt-python-3.9.0v3.9.0Daniel Veillard2017-11-021-1/+1
|
* 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>
* Avoid implicit treatment of an arithmetic result as a booleanDaniel P. Berrange2017-09-261-1/+1
| | | | | | | | | | | | | | | Latest GCC versions are unhappy with us treating an integer arithmetic result as a boolean: libvirt-utils.c: In function ‘virReallocN’: libvirt-utils.c:111:23: warning: ‘*’ in boolean context, suggest ‘&&’ instead [-Wint-in-bool-context] if (!tmp && (size * count)) { ~~~~~~^~~~~~~~ Add an explicit comparison '!= 0' to keep it happy, since its suggestion to use '&&' is nonsense. Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
* Fix comparisons between signed & unsigned integersDaniel P. Berrange2017-09-264-60/+60
| | | | | | | | | 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>
* libvirtaio: add .drain() coroutineWojtek Porczyk2017-09-261-2/+34
| | | | | | | | The intended use is to ensure that the implementation is empty, which is one way to ensure that all connections were properly closed and file descriptors reclaimed. Signed-off-by: Wojtek Porczyk <woju@invisiblethingslab.com>
* libvirtaio: keep track of the current implementationWojtek Porczyk2017-09-261-2/+14
| | | | | | | | Since 7534c19 it is not possible to register event implementation twice. Instead, allow for retrieving the current one, should it be needed afterwards. Signed-off-by: Wojtek Porczyk <woju@invisiblethingslab.com>
* libvirtaio: fix closing of the objectsWojtek Porczyk2017-09-261-6/+1
| | | | | | | | - Descriptor.close() was a dead code, never used. - TimeoutCallback.close(), as a cleanup function, should have called super() as last statement, not first Signed-off-by: Wojtek Porczyk <woju@invisiblethingslab.com>
* libvirtaio: do not double-add callbacksWojtek Porczyk2017-09-261-5/+4
| | | | | | | This was a harmless bug, without any impact, but it is wrong to manage the collection of callbacks from it's members. Signed-off-by: Wojtek Porczyk <woju@invisiblethingslab.com>
* libvirtaio: cache the list of callbacks when callingWojtek Porczyk2017-09-261-1/+1
| | | | | | | | | | | | | | | | | | | When the callback causes something that results in changes wrt registered handles, python aborts iteration. Relevant error message: Exception in callback None() handle: <Handle cancelled> Traceback (most recent call last): File "/usr/lib64/python3.5/asyncio/events.py", line 126, in _run self._callback(*self._args) File "/usr/lib64/python3.5/site-packages/libvirtaio.py", line 99, in _handle for callback in self.callbacks.values(): RuntimeError: dictionary changed size during iteration QubesOS/qubes-issues#2805 Signed-off-by: Wojtek Porczyk <woju@invisiblethingslab.com>