1
0
mirror of https://gitlab.com/libvirt/libvirt-python.git synced 2025-07-17 00:59:36 +03:00
Commit Graph

885 Commits

Author SHA1 Message Date
26fd22c004 travis: add testing of 5.0.0 release
Update to test against very latest release. Since we dropped two
python versions, we can afford to add new libvirt version without
dropping a previous one.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2019-01-24 17:17:09 +00:00
6670080bc3 travis: switch from trusty to xenial dist
The trusty gnutls version is too old to support modern libvirt

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2019-01-24 17:17:05 +00:00
8bafc3052f travis: remove python 2.6 and 3.6 from build matrix
The lxml package that we download with pip no longer supports either
of these versions of python.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2019-01-24 17:16:55 +00:00
8bd4c9374a rpm spec: remove %{extra_release} from spec
The %{extra_release} field was previously populated by data from the old
autobuild.sh file but is no longer used.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2019-01-22 11:20:04 +00:00
6c80cf5415 Release of libvirt-python 5.0.0
* setup.py: updated for release

Signed-off-by: Daniel Veillard <veillard@redhat.com>
v5.0.0
2019-01-15 20:34:03 +01:00
c57981ca71 Release of libvirt-python-4.10.0
* setup.py: update to bump release number

Signed-off-by: Daniel Veillard <veillard@redhat.com>
v4.10.0
2018-12-03 13:23:07 +01:00
389cc9d0c7 Add daemon to list of shutdown reasons
Add the support to work with libvirt commit 66a85cb13.

Signed-off-by: Philipp Hahn <hahn@univention.de>
2018-11-26 14:13:49 +01:00
8f745819c9 Fix copy paste error on the version check value
Signed-off-by: John Ferlan <jferlan@redhat.com>
2018-11-20 13:54:52 -05:00
9bc102103c Implement API binding for virDomainSetIOThreadParams
Similar to libvirt_virDomainBlockCopy (and migration API's). Create
the code for the new API.

Signed-off-by: John Ferlan <jferlan@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2018-11-20 13:24:18 -05:00
2b4bd07e0a Add check for params, nparams being a dictionary
If PyDict_Check fails, we should force an error rather than
blindly continuing on.

Signed-off-by: John Ferlan <jferlan@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2018-11-20 13:24:13 -05:00
1479577af3 Add missing virPyDictToTypedParams for libvirt_virDomainBlockCopy
Need to free params like similar API's such as libvirt_virDomainMigrate3
and libvirt_virDomainMigrateToURI3.

Signed-off-by: John Ferlan <jferlan@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2018-11-20 11:26:37 -05:00
2f3ed45cd8 Fix typos in virDomainSetSchedulerParameters name
Signed-off-by: John Ferlan <jferlan@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2018-11-20 11:21:42 -05:00
65d63bca20 Release of libvirt-python 4.9.0
* setup.py: update for new release

Signed-off-by: Daniel Veillard <veillard@redhat.com>
v4.9.0
2018-11-04 18:15:48 +01:00
9af6f1a5d3 event-test.py: Report ERROR events
VIR_DOMAIN_EVENT_ID_IO_ERROR and VIR_DOMAIN_EVENT_ID_IO_ERROR_REASON
callbacks receive the same 'action' parameter, so also translate that
numeric action to a descriptive text for the first callback.

Signed-off-by: Philipp Hahn <hahn@univention.de>
2018-11-01 14:09:20 +01:00
c8b6e5fc3c event-test.py: Fix ERROR event
ERROR_EVENTS translates the numeric 'action' argument to a description,
not the 'reason' argument which already contains a descriptive string
like 'enospc'.

> Traceback (most recent call last):
>   File "/usr/lib/python2.7/dist-packages/libvirt.py", line 4661, in _dispatchDomainEventIOErrorReasonCallback
>     reason, opaque)
>   File "libvirt-python/examples/event-test.py", line 536, in myDomainEventIOErrorReasonCallback
>     dom.name(), dom.ID(), srcpath, devalias, action, ERROR_EVENTS[reason]))
>   File "libvirt-python/examples/event-test.py", line 474, in __getitem__
>     data = self.args[item]
> TypeError: tuple indices must be integers, not str

Fixes: f5928c6711
Signed-off-by: Philipp Hahn <hahn@univention.de>
2018-11-01 14:09:20 +01:00
b1828e604f Release of libvirt-python 4.8.0
Signed-off-by: Daniel Veillard <veillard@redhat.com>

- setup.py : updated for release
v4.8.0
2018-10-01 17:40:35 +02:00
9dff88056c event-test.py: Fix blanks
Closer to pep8

Signed-off-by: Philipp Hahn <hahn@univention.de>
2018-09-24 09:06:00 +02:00
10ba71a0a0 event-test.py: Convert CONNECTION events
to use new Description class

Signed-off-by: Philipp Hahn <hahn@univention.de>
2018-09-24 09:06:00 +02:00
bf7c6135e8 event-test.py: Convert SECRET events
to use new Description class

Signed-off-by: Philipp Hahn <hahn@univention.de>
2018-09-24 09:06:00 +02:00
c0235d01e7 event-test.py: Convert DEVICE events
to use new Description class

Signed-off-by: Philipp Hahn <hahn@univention.de>
2018-09-24 09:06:00 +02:00
808625fac7 event-test.py: Convert STORAGE events
to use new Description class

Signed-off-by: Philipp Hahn <hahn@univention.de>
2018-09-24 09:06:00 +02:00
616c7c3482 event-test.py: Convert NETWORK events
to use new Description class

Signed-off-by: Philipp Hahn <hahn@univention.de>
2018-09-24 09:06:00 +02:00
298f90c6ef event-test.py: Convert TRAY events
to use new Description class

Signed-off-by: Philipp Hahn <hahn@univention.de>
2018-09-24 09:06:00 +02:00
6a41da247d event-test.py: Convert DISK events
to use new Description class

Signed-off-by: Philipp Hahn <hahn@univention.de>
2018-09-24 09:06:00 +02:00
f58fcd69d2 event-test.py: Convert GRAPHICS events
to use new Description class

Signed-off-by: Philipp Hahn <hahn@univention.de>
2018-09-24 09:06:00 +02:00
dfa00dddd5 event-test.py: Convert AGENT events
to use new Description class

Signed-off-by: Philipp Hahn <hahn@univention.de>
2018-09-24 09:06:00 +02:00
f5928c6711 event-test.py: Convert ERROR events
to use new Description class

Signed-off-by: Philipp Hahn <hahn@univention.de>
2018-09-24 09:06:00 +02:00
ba45c10511 event-test.py: Convert WATCHDOG events
to use new Description class

Signed-off-by: Philipp Hahn <hahn@univention.de>
2018-09-24 09:06:00 +02:00
e5ecf38911 event-test.py: Convert BLOCKJOB events
to use new Description class

Signed-off-by: Philipp Hahn <hahn@univention.de>
2018-09-24 09:06:00 +02:00
257157c984 event-test.py: Convert LIVECYCLE events
to use new Description class

Signed-off-by: Philipp Hahn <hahn@univention.de>
2018-09-24 09:06:00 +02:00
26350dc97d event-test.py: Add class for event descriptions
Signed-off-by: Philipp Hahn <hahn@univention.de>
2018-09-24 09:06:00 +02:00
37e56947cc event-test.py: Simplify event ID lists
by directly building the list with the IDs instead of appending them
explicitly.

Signed-off-by: Philipp Hahn <hahn@univention.de>
2018-09-24 09:06:00 +02:00
73b5ae581c event-test.py: Merge livecycle callbacks
Registering the same function twice using the old domainEventRegister()
interface would not work, as the function reference is used for
un-registering.

But it is not a problem with the new interface domainEventRegisterAny(),
as that returns a unique ID.

While at it also demonstrate the 'opaque' mechanism.

Signed-off-by: Philipp Hahn <hahn@univention.de>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
2018-09-24 09:06:00 +02:00
d408dc944d event-test.py: Use __file__
instead of sys.argv[0]

Signed-off-by: Philipp Hahn <hahn@univention.de>
2018-09-24 09:05:59 +02:00
655b94803e event-test.py: Add missing globale statement
to fix loop termination on exit.

Signed-off-by: Philipp Hahn <hahn@univention.de>
2018-09-24 09:05:59 +02:00
b7d5d60274 event-test.py: Remove dead assignment
variable is unused

Signed-off-by: Philipp Hahn <hahn@univention.de>
2018-09-24 09:05:59 +02:00
5a7a871961 event-test.py: Remove extra parenthesis
Signed-off-by: Philipp Hahn <hahn@univention.de>
2018-09-24 09:05:59 +02:00
77e700c501 event-test.py: Handle closed connection
If libvirtd terminates while event-test.py has an open connection to it,
it will crash with the following traceback:

> myConnectionCloseCallback: qemu:///session: Error
> Exception in thread libvirtEventLoop:
> Traceback (most recent call last):
>   File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner
>     self.run()
>   File "/usr/lib/python2.7/threading.py", line 754, in run
>     self.__target(*self.__args, **self.__kwargs)
>   File "examples/event-test.py", line 424, in virEventLoopPollRun
>     eventLoop.run_loop()
>   File "examples/event-test.py", line 242, in run_loop
>     self.run_once()
>   File "examples/event-test.py", line 187, in run_once
>     libvirt.virEventInvokeFreeCallback(opaque)
> AttributeError: 'module' object has no attribute 'virEventInvokeFreeCallback'
>
> libvirt: XML-RPC error : internal error: client socket is closed
> Traceback (most recent call last):
>   File "examples/event-test.py", line 872, in <module>
>     main()
>   File "examples/event-test.py", line 854, in main
>     vc.secretEventDeregisterAny(id)
>   File "/usr/lib/python2.7/dist-packages/libvirt.py", line 4987, in secretEventDeregisterAny
>     if ret == -1: raise libvirtError ('virConnectSecretEventDeregisterAny() failed', conn=self)
> libvirt.libvirtError: internal error: client socket is closed
> Closing qemu:///session

Skip unregistering the event callbacks and closing the connection if the
connection is already broken / closed.

Signed-off-by: Philipp Hahn <hahn@univention.de>
2018-09-24 09:05:59 +02:00
d5342a9803 event-test.py: Sync list of domain lifecycle events
Add new events to prevent crash:
> Traceback (most recent call last):
>   File "/usr/lib/python2.7/dist-packages/libvirt.py", line 4601, in _dispatchDomainEventCallbacks
>     cb(self, virDomain(self, _obj=dom), event, detail, opaque)
>   File "libvirt-python/examples/event-test.py", line 505, in myDomainEventCallback1
>     domDetailToString(event, detail)))
>   File "libvirt-python/examples/event-test.py", line 484, in domDetailToString
>     return domEventStrings[event][detail]
> IndexError: tuple index out of range

Signed-off-by: Philipp Hahn <hahn@univention.de>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
2018-09-24 09:05:59 +02:00
fc4000152e Release of libvirt-python=4.7.0
* setup.py: updated for release

Signed-off-by: Daniel Veillard <veillard@redhat.com>
v4.7.0
2018-09-03 19:23:31 +02:00
0159ae02df Release of libvirt-python-4.6.0
* setup.py: updated for release

Signed-off-by: Daniel Veillard <veillard@redhat.com>
v4.6.0
2018-08-06 11:42:06 +02:00
7b4d676065 rpm: update min required rhel/fedora
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2018-07-23 14:10:58 +01:00
cc55ae62d7 rpm: add BuildRequires on gcc
The gcc RPM is no longer part of the default build root.

Reviewed-by: Andrea Bolognani <abologna@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2018-07-23 14:10:56 +01:00
5ca2cb0018 rpm: use the versioned python2 macro names
The use of non-versioned python2 macro names is deprecated in Fedora

Reviewed-by: Andrea Bolognani <abologna@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2018-07-23 14:10:37 +01:00
f2b3e946e2 travis: add libvirt 4.5.0 version to build matrix
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2018-07-16 15:27:26 +01:00
d68c14e069 fix build with older libvirt missing virNWFilterBindingPtr
While we correctly disable all public API bindings that rely on
virNWFilterBindingPtr, the generator is still creating a helper function
that needs it - libvirt_virNWFilterBinding_pointer. Making this helper
conditional is a little hairy, so just provide a trivial typedef to keep
it happy.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2018-07-16 15:26:53 +01:00
2efd1e9ab2 spec: Remove Group: and %defattr
These are only needed for RHEL5 builds, which are no longer supported

https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/message/CMCUBB4SWS3URHTRRS3OPFM4HF5CGKBW/
https://fedoraproject.org/wiki/RPMGroups

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2018-07-10 13:34:44 -04:00
74b1e6d3f8 Release of libvirt-python-4.5.0
* setup.py: updated for release

Signed-off-by: Daniel Veillard <veillard@redhat.com>
v4.5.0
2018-07-02 22:17:36 +02:00
c1f06dde29 Fix bugs in nwfilter binding APIs
We did not correctly mangle the API names in two cases, and we also
forgot to specialize the lookup method name in the sanity test.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2018-06-28 12:29:21 +01:00
d5aae37c61 Add support for nwfilter binding objects / apis
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2018-06-28 12:04:05 +01:00