Merge ~paelzer/ubuntu/+source/libvirt-python:merge-7.6-impish into ubuntu/+source/libvirt-python:ubuntu/impish-devel

Proposed by Christian Ehrhardt 
Status: Merged
Approved by: Christian Ehrhardt 
Approved revision: 423b873b5fc4d462fde7c90cd88d23cc4a346689
Merged at revision: 423b873b5fc4d462fde7c90cd88d23cc4a346689
Proposed branch: ~paelzer/ubuntu/+source/libvirt-python:merge-7.6-impish
Merge into: ubuntu/+source/libvirt-python:ubuntu/impish-devel
Diff against target: 704 lines (+393/-48)
16 files modified
AUTHORS (+3/-0)
ChangeLog (+271/-0)
PKG-INFO (+1/-1)
README (+11/-2)
debian/changelog (+7/-0)
debian/control (+2/-1)
debian/tests/control (+1/-1)
debian/tests/smoke3 (+1/-1)
generator.py (+10/-6)
libvirt-override-api.xml (+6/-0)
libvirt-override.c (+55/-5)
libvirt-python.spec (+5/-5)
setup.py (+14/-20)
tests/test_conn.py (+3/-3)
tests/test_domain.py (+1/-1)
tox.ini (+2/-2)
Reviewer Review Type Date Requested Status
Robie Basak Approve
Canonical Server Pending
git-ubuntu developers Pending
Review via email: mp+407174@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

We usually bump this along libvirt itself which is about to happen.
PPA: https://launchpad.net/~ci-train-ppa-service/+archive/ubuntu/4644

Revision history for this message
Robie Basak (racb) wrote :
Download full text (4.2 KiB)

What orig tarball are you planning to use for this upload?

Your "New upstream version 7.6.0" shows me:

$ git log -1 -p --name-status c3539dc
commit c3539dc
Author: Christian Ehrhardt <email address hidden>
Date: Mon Aug 16 12:37:50 2021 +0200

    New upstream version 7.6.0

A .ctags
A .dir-locals.el
A .github/lockdown.yml
A .gitignore
A .gitlab-ci.yml
A .mailmap
D AUTHORS
A AUTHORS.in
A CONTRIBUTING.rst
D ChangeLog
A HACKING
D MANIFEST
A Makefile
D PKG-INFO
M README
A ci/containers/README.rst
A ci/containers/ci-centos-8.Dockerfile
A ci/containers/ci-centos-stream-8.Dockerfile
A ci/containers/ci-debian-10.Dockerfile
A ci/containers/ci-debian-sid.Dockerfile
A ci/containers/ci-fedora-33.Dockerfile
A ci/containers/ci-fedora-34.Dockerfile
A ci/containers/ci-fedora-rawhide.Dockerfile
A ci/containers/ci-opensuse-leap-152.Dockerfile
A ci/containers/ci-opensuse-tumbleweed.Dockerfile
A ci/containers/ci-ubuntu-1804.Dockerfile
A ci/containers/ci-ubuntu-2004.Dockerfile
A ci/containers/refresh
A examples/README
A examples/dhcpleases.py
M generator.py
M libvirt-override-api.xml
M libvirt-override.c
D libvirt-python.spec
A libvirt-python.spec.in
A requirements-test.txt
M setup.py
M tests/test_conn.py
M tests/test_domain.py
A tests/test_domain_checkpoint.py
A tests/test_domain_snapshot.py
A tests/test_interface.py
A tests/test_network.py
A tests/test_nodedev.py
A tests/test_storage.py
M tox.ini

This mismatches the upstream tarball fetched (and gpg validated) by uscan as follows:

Extraneous files:

    .ctags
    .dir-locals.el
    .github/lockdown.yml
    .gitignore
    .gitlab-ci.yml
    .mailmap
    AUTHORS.in
    CONTRIBUTING.rst
    HACKING
    Makefile
    ci/containers/README.rst
    ci/containers/ci-centos-8.Dockerfile
    ci/containers/ci-centos-stream-8.Dockerfile
    ci/containers/ci-debian-10.Dockerfile
    ci/containers/ci-debian-sid.Dockerfile
    ci/containers/ci-fedora-33.Dockerfile
    ci/containers/ci-fedora-34.Dockerfile
    ci/containers/ci-fedora-rawhide.Dockerfile
    ci/containers/ci-opensuse-leap-152.Dockerfile
    ci/containers/ci-opensuse-tumbleweed.Dockerfile
    ci/containers/ci-ubuntu-1804.Dockerfile
    ci/containers/ci-ubuntu-2004.Dockerfile
    ci/containers/refresh
    examples/README
    examples/dhcpleases.py
    libvirt-python.spec.in
    requirements-test.txt
    tests/test_domain_checkpoint.py
    tests/test_domain_snapshot.py
    tests/test_interface.py
    tests/test_network.py
    tests/test_nodedev.py
    tests/test_storage.py

Missing files:

    AUTHORS
    ChangeLog
    MANIFEST
    PKG-INFO
    libvirt-python.spec

This seems to roughly inversely match your commit. It appears as though you've switched from the release tarball to a git snapshot. Wouldn't it be better to stick to what Debian are doing here? This has the additional advantage that uscan can be used to verify the orig tarball comes from and is signed by the same ...

Read more...

review: Needs Fixing
Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

#1 tarball
Yep I ignored uscan (bad me) and used the one from github.
Replaced it now - thanks for the catch - also reduces the chance to conflict with Debian.

#2 tests
yes IIRC the tests so far never ran at build time
While not being used as build-time test they actually run (with better coverage since it also checks other updates) as autopkgtest:
https://autopkgtest.ubuntu.com/results/autopkgtest-impish/impish/amd64/libv/libvirt-python/20210714_035726_1103b@/log.gz

I've ensured that this runs again after upstream switched to pytest.

In a VMtest it now is:
...
autopkgtest [08:21:45]: test smoke3: [-----------------------
+ pytest-3 -v
============================= test session starts ==============================
platform linux -- Python 3.9.6, pytest-6.0.2, py-1.10.0, pluggy-0.13.0 -- /usr/bin/python3
cachedir: .pytest_cache
rootdir: /tmp/autopkgtest.0qnrl5/build.duE/src
collecting ... collected 6 items

tests/test_conn.py::TestLibvirtConn::testConnDomainList PASSED [ 16%]
tests/test_conn.py::TestLibvirtConnAuth::testOpenAuthBad PASSED [ 33%]
tests/test_conn.py::TestLibvirtConnAuth::testOpenAuthGood PASSED [ 50%]
tests/test_conn.py::TestLibvirtConnAuth::testOpenAuthNone PASSED [ 66%]
tests/test_domain.py::TestLibvirtDomain::testDomainSchedParams PASSED [ 83%]
tests/test_domain.py::TestLibvirtDomain::testScreenshot PASSED [100%]

============================== 6 passed in 0.08s ===============================
+ echo Smoke test of python3 version succesful
...

Force-pushing this onto the branch for a re-check.

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :
Revision history for this message
Robie Basak (racb) wrote :

+1, thanks.

I just wondered about upload ordering. Does this need libvirt uploading first? If so, does it need to have the versioned build depends bumped? Anyway, I leave that up to you.

review: Approve
Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

To ssh://git.launchpad.net/~usd-import-team/ubuntu/+source/libvirt-python
 * [new tag] upload/7.6.0-0ubuntu1 -> upload/7.6.0-0ubuntu1

Uploading to ubuntu (via ftp to upload.ubuntu.com):
  Uploading libvirt-python_7.6.0-0ubuntu1.dsc: done.
  Uploading libvirt-python_7.6.0.orig.tar.gz: done.
  Uploading libvirt-python_7.6.0-0ubuntu1.debian.tar.xz: done.
  Uploading libvirt-python_7.6.0-0ubuntu1_source.buildinfo: done.
  Uploading libvirt-python_7.6.0-0ubuntu1_source.changes: done.
Successfully uploaded packages.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/AUTHORS b/AUTHORS
2index 40640e6..21cf7b6 100644
3--- a/AUTHORS
4+++ b/AUTHORS
5@@ -12,6 +12,7 @@ The individual contributors are
6 Adam Litke <agl@us.ibm.com>
7 Alex Jia <ajia@redhat.com>
8 Andrea Bolognani <abologna@redhat.com>
9+ Beraldo Leal <bleal@redhat.com>
10 Boris Fiuczynski <fiuczy@linux.vnet.ibm.com>
11 Brian Rak <brak@gameservers.com>
12 Chris Lalancette <clalance@redhat.com>
13@@ -75,6 +76,7 @@ The individual contributors are
14 Pradipta Kr. Banerjee <pradipta.banerjee@gmail.com>
15 Qiaowei Ren <qiaowei.ren@intel.com>
16 Radostin Stoyanov <rstoyanov@fedoraproject.org>
17+ renlei4 <ren.lei4@zte.com.cn>
18 Richard W.M. Jones <rjones@redhat.com>
19 Robie Basak <robie.basak@canonical.com>
20 Serge E. Hallyn <serge.hallyn@canonical.com>
21@@ -87,6 +89,7 @@ The individual contributors are
22 Victor Stinner <victor.stinner@gmail.com>
23 Viktor Mihajlovski <mihajlov@linux.vnet.ibm.com>
24 Vincent Vanlaer <vincent.vanlaer@skynet.be>
25+ w00506750 <hogan.wang@huawei.com>
26 Wojtek Porczyk <woju@invisiblethingslab.com>
27 Wu Zongyong <wuzongyo@mail.ustc.edu.cn>
28 Xavier Fernandez <xav.fernandez@gmail.com>
29diff --git a/ChangeLog b/ChangeLog
30index 859aab8..ee0aa80 100644
31--- a/ChangeLog
32+++ b/ChangeLog
33@@ -1,3 +1,274 @@
34+2021-07-27 Daniel P. Berrangé <berrange@redhat.com>
35+
36+ gitlab: use custom docker:dind image
37+ The current docker:dind container has broken default seccomp filter that
38+ results in clone3 being blocked, which in turn breaks Fedora 35 rawhide.
39+
40+ This custom image has a workaround that causes the seccomp filter to
41+ return ENOSYS for clone3 instad of EPERM, thus triggering glibc to
42+ fallback to clone correctly.
43+
44+
45+
46+2021-07-01 Jiri Denemark <jdenemar@redhat.com>
47+
48+ Post-release version bump to 7.6.0
49+
50+
51+2021-06-25 Peter Krempa <pkrempa@redhat.com>
52+
53+ Fix BlockThreshold Callback argument conversion once more
54+ The conversion was changed from "OssiiO" to "OssLLO". Unfortunately the
55+ arguments are unsigned long long, where the proper coversion character
56+ is 'K'.
57+
58+ Fixes: https://gitlab.com/libvirt/libvirt-python/-/merge_requests/40
59+ Fixes: fd069ac85c8cf1593587dc9287a3d5eb6bd4bdb9
60+ Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1976109
61+
62+
63+2021-06-01 Jiri Denemark <jdenemar@redhat.com>
64+
65+ Post-release version bump to 7.5.0
66+
67+
68+2021-05-27 w00506750 <hogan.wang@huawei.com>
69+
70+ iothread: fix memory access out of bounds
71+ When the 'pcpu' is larger then the last 'iothr->cpumap' bits,
72+ set the list element to False to avoid out of bounds access
73+ 'iothr->cpumap'.
74+
75+ Reviewed-by: Hogan Wang <hogan.wang@huawei.com>
76+
77+
78+2021-05-27 Jiri Denemark <jdenemar@redhat.com>
79+
80+ Post-release version bump to 7.4.0
81+
82+
83+2021-05-25 Daniel P. Berrangé <berrange@redhat.com>
84+
85+ containers: refresh containers with latest libvirt-ci
86+
87+
88+2021-05-25 Daniel P. Berrangé <berrange@redhat.com>
89+
90+ gitlab: don't set RPM variable on container job
91+
92+
93+2021-05-25 Daniel P. Berrangé <berrange@redhat.com>
94+
95+ gitlab: add OpenSUSE Tumbleweed container and build
96+
97+
98+2021-05-25 Daniel P. Berrangé <berrange@redhat.com>
99+
100+ gitlab: introduce Fedora 34 container and build
101+
102+
103+2021-05-25 Daniel P. Berrangé <berrange@redhat.com>
104+
105+ gitlab: rename opensuse-152 to opensuse-leap-152
106+
107+
108+2021-05-25 Daniel P. Berrangé <berrange@redhat.com>
109+
110+ gitlab: rename centos-stream to centos-stream-8
111+
112+
113+2021-05-25 Daniel P. Berrangé <berrange@redhat.com>
114+
115+ gitlab: drop Fedora 32 container and build
116+
117+
118+2021-05-25 Daniel P. Berrangé <berrange@redhat.com>
119+
120+ gitlab: drop centos-7 container and build
121+
122+
123+2021-04-15 Michal Privoznik <mprivozn@redhat.com>
124+
125+ generator.py: Untangle virNodeDevice name fixup
126+ The way that virNodeDevice method name fixup is written makes it
127+ hard to find via grep (matching the virNodeDevice prefix and then
128+ matching only the operation like "Get", "Lookup", ...). Expand
129+ the string matching to match the pattern of other cases.
130+
131+
132+
133+2021-04-15 Michal Privoznik <mprivozn@redhat.com>
134+
135+ generator.py: Fix method names for new virNodeDevice*() APIs
136+ In the 7.3.0 release we are going to have three new public APIs:
137+
138+ virNodeDeviceDefineXML()
139+ virNodeDeviceUndefine()
140+ virNodeDeviceCreate()
141+
142+ The first one is slightly problematic, because it takes
143+ virConnectPtr argument and thus our generator wants to put its
144+ wrapper under virConnect python class, which is correct, but
145+ what's incorrect is the name it chooses for the method:
146+ defineXML(). Such method already exists and wraps
147+ virDomainDefineXML() around. Also, the name is rather confusing
148+ anyway - it's missing the 'nodeDevice' prefix.
149+
150+ Fortunately, the fix is easy - add another case into nameFixup().
151+
152+ The story with virNodeDeviceCreate() is similar. Except, this time
153+ the class in which the method was put is correct. But the name is
154+ still wrong, because our generator matched 'virNodeDeviceCreate'
155+ thinking it's the good old virNodeDeviceCreateXML() API and
156+ "fixed" the name of the method to nodeDeviceCreate().
157+
158+ Luckily, virNodeDeviceUndefine() is just fine.
159+
160+
161+
162+2021-04-12 Ján Tomko <jtomko@redhat.com>
163+
164+ spec: use pytest instead of nose
165+
166+
167+2021-04-12 Daniel P. Berrangé <berrange@redhat.com>
168+
169+ rpm: use HTTPS for URLs
170+
171+
172+2021-04-09 Daniel P. Berrangé <berrange@redhat.com>
173+
174+ Don't run sanity checks by default
175+ The sanity check scripts verify that the binding covers all APIs in the
176+ libvirt library/headers being built against. This is primarily there for
177+ libvirt maintainers to identify when there are gaps in API coverage.
178+
179+ This is not something downstream consumers of libvirt-python should be
180+ running themselves, so we shouldn't added it to tests by default.
181+
182+ In addition if people are working on branches or submitting merge
183+ requests for python changes, we shouldn't block their work for failed
184+ API coverage sanity tests, if the python binding otherwise builds fine
185+ and passes regular unit tests.
186+
187+ Thus, we introduce a new gitlab job "api-coverage" with some conditions:
188+
189+ - If pushing to a branch, the job is treated as non-fatal
190+ - For regular scheduled builds, it is mandatory
191+ - Don't run in any other scenarios
192+
193+ This job uses the artifacts from the centos-8-git-build job and re-runs
194+ the test suite, requesting the sanity tests to be run too.
195+
196+ This will achieve the result of letting us see missing API coverage
197+ in nightly builds, without blocking other contributions.
198+
199+
200+
201+2021-04-07 Ján Tomko <jtomko@redhat.com>
202+
203+ tests: use assertEqual instead of assertEquals
204+ tests/test_conn.py:17: DeprecationWarning: Please use assertEqual instead.
205+
206+
207+
208+2021-04-07 Ján Tomko <jtomko@redhat.com>
209+
210+ ci: refresh containers for nose->pytest switch
211+ Matches libvirt-ci commit facd5d855c97bf5b127ff9bf245c8fdf514dd916
212+
213+
214+
215+2021-04-07 Ján Tomko <jtomko@redhat.com>
216+
217+ setup: use pytest instead of nose to run the test suite
218+ The software we use for running tests - nose - has been
219+ deprecated in favor of nose2.
220+
221+ We don't use anything nose-specific, just unittest.TestCase,
222+ which pytest can handle just fine.
223+
224+ Switch to using pytest, which we already use for libvirt-dbus.
225+
226+
227+
228+2021-04-07 Ján Tomko <jtomko@redhat.com>
229+
230+ setup: drop have_libvirtaio
231+ This function says we have libvirtaio on Python >= 3.3,
232+ however we already mandate Python >= 3.5 at the start of the file.
233+
234+
235+
236+2021-04-07 Andrea Bolognani <abologna@redhat.com>
237+
238+ ci: Move dco job to sanity_checks stage
239+ If the DCO check fails we still want the pipeline to fail, but
240+ that doesn't mean there's no value in running the other jobs to
241+ get a better picture.
242+
243+
244+
245+2021-04-07 Andrea Bolognani <abologna@redhat.com>
246+
247+ ci: Use 'extends' GitLab CI feature
248+ This is the recommended way to use templates in job
249+ definitions.
250+
251+
252+
253+2021-04-06 Ján Tomko <jtomko@redhat.com>
254+
255+ ci: drop openSUSE leap 15.1 in favor of 15.2
256+
257+
258+2021-04-06 Ján Tomko <jtomko@redhat.com>
259+
260+ ci: refresh dockerfiles
261+ Refresh to match libvirt-ci commit 94c25bde639eb31ff2071fb6abfd3d5c777f4ab2
262+
263+
264+
265+2021-04-01 Jiri Denemark <jdenemar@redhat.com>
266+
267+ Post-release version bump to 7.3.0
268+
269+
270+2021-03-01 Jiri Denemark <jdenemar@redhat.com>
271+
272+ Post-release version bump to 7.2.0
273+
274+
275+2021-03-01 renlei4 <ren.lei4@zte.com.cn>
276+
277+ Fix wrong type for BlockThreshold Callback
278+ type of threshold and excess are unsigned long long,
279+ but PyObject_CallMethod incorrectly set it to int.
280+
281+ if threshold or excess greater than 0x7FFFFFFF(max int),
282+ those variables will overflow.
283+
284+
285+
286+2021-02-15 Daniel P. Berrangé <berrange@redhat.com>
287+
288+ Add impl override for virDomainGetMessages
289+
290+
291+2021-02-09 Beraldo Leal <bleal@redhat.com>
292+
293+ improving readme with requirements
294+ When installing this library in a fresh system, some basic packages are
295+ necessary to compile and run. This patch will add basic instructions
296+ with some requirements to help new contributors and users.
297+
298+
299+
300+2021-01-15 Jiri Denemark <jdenemar@redhat.com>
301+
302+ Post-release version bump to 7.1.0
303+
304+
305 2020-12-15 Daniel P. Berrangé <berrange@redhat.com>
306
307 ci: refresh containers for CentOS-8 PowerTools repo rename
308diff --git a/PKG-INFO b/PKG-INFO
309index 8fddd90..f5661da 100644
310--- a/PKG-INFO
311+++ b/PKG-INFO
312@@ -1,6 +1,6 @@
313 Metadata-Version: 1.1
314 Name: libvirt-python
315-Version: 7.0.0
316+Version: 7.6.0
317 Summary: The libvirt virtualization API python binding
318 Home-page: http://www.libvirt.org
319 Author: Libvirt Maintainers
320diff --git a/README b/README
321index 96082f0..90f8b28 100644
322--- a/README
323+++ b/README
324@@ -1,5 +1,5 @@
325- Libvirt Python Binding README
326- =============================
327+Libvirt Python Binding README
328+=============================
329
330 This package provides a python binding to the libvirt.so,
331 libvirt-qemu.so and libvirt-lxc.so library APIs.
332@@ -10,6 +10,15 @@ is 0.9.11 or newer.
333 This code is distributed under the terms of the LGPL version
334 2 or later.
335
336+Requirements
337+------------
338+
339+To build the libvirt python binary requires the GCC and pkg-config
340+tools, and development headers for the libvirt and python libraries.
341+
342+Building and installing
343+-----------------------
344+
345 The module can be built by following the normal python module
346 build process
347
348diff --git a/debian/changelog b/debian/changelog
349index 7d05eb4..f49cad1 100644
350--- a/debian/changelog
351+++ b/debian/changelog
352@@ -1,3 +1,10 @@
353+libvirt-python (7.6.0-0ubuntu1) impish; urgency=medium
354+
355+ * New upstream version 7.6.0
356+ - d/t/control, d/t/smoke3: tests now use pytest
357+
358+ -- Christian Ehrhardt <christian.ehrhardt@canonical.com> Mon, 16 Aug 2021 12:38:16 +0200
359+
360 libvirt-python (7.0.0-2) unstable; urgency=medium
361
362 * Upload to unstable
363diff --git a/debian/control b/debian/control
364index 8cd4ea7..733f56b 100644
365--- a/debian/control
366+++ b/debian/control
367@@ -1,7 +1,8 @@
368 Source: libvirt-python
369 Section: python
370 Priority: optional
371-Maintainer: Guido Günther <agx@sigxcpu.org>
372+Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
373+XSBC-Original-Maintainer: Guido Günther <agx@sigxcpu.org>
374 Build-Depends: debhelper-compat (=13),
375 dh-python,
376 pkg-config,
377diff --git a/debian/tests/control b/debian/tests/control
378index 16e8fe9..2e531c8 100644
379--- a/debian/tests/control
380+++ b/debian/tests/control
381@@ -1,5 +1,5 @@
382 Tests: smoke3
383 Depends: python3-libvirt,
384- python3-nose
385+ python3-pytest
386 Restrictions: allow-stderr
387
388diff --git a/debian/tests/smoke3 b/debian/tests/smoke3
389index fce1151..f2f6e6a 100755
390--- a/debian/tests/smoke3
391+++ b/debian/tests/smoke3
392@@ -3,7 +3,7 @@
393 set -e
394 set -x
395
396-nosetests3 -v
397+pytest-3 -v
398
399 echo 'Smoke test of python3 version succesful'
400 exit 0
401diff --git a/generator.py b/generator.py
402index 6dd1430..ceaad46 100755
403--- a/generator.py
404+++ b/generator.py
405@@ -479,6 +479,7 @@ skip_impl = {
406 'virDomainGetGuestInfo',
407 'virDomainAuthorizedSSHKeysGet',
408 'virDomainAuthorizedSSHKeysSet',
409+ 'virDomainGetMessages',
410 }
411
412 lxc_skip_impl = {
413@@ -1236,13 +1237,16 @@ def nameFixup(name: str, classe: str, type: str, file: str) -> str:
414 elif name[0:13] == "virStorageVol":
415 func = name[13:]
416 func = func[0:1].lower() + func[1:]
417+ elif name[0:16] == "virNodeDeviceGet":
418+ func = name[16].lower() + name[17:]
419+ elif name[0:19] == "virNodeDeviceLookup":
420+ func = name[3].lower() + name[4:]
421+ elif name[0:22] == "virNodeDeviceCreateXML":
422+ func = name[3].lower() + name[4:]
423+ elif name[0:19] == "virNodeDeviceDefine":
424+ func = name[3].lower() + name[4:]
425 elif name[0:13] == "virNodeDevice":
426- if name[13:16] == "Get":
427- func = name[16].lower() + name[17:]
428- elif name[13:19] == "Lookup" or name[13:19] == "Create":
429- func = name[3].lower() + name[4:]
430- else:
431- func = name[13].lower() + name[14:]
432+ func = name[13].lower() + name[14:]
433 elif name[0:7] == "virNode":
434 func = name[7:]
435 func = func[0:1].lower() + func[1:]
436diff --git a/libvirt-override-api.xml b/libvirt-override-api.xml
437index 02b0856..a96e5c4 100644
438--- a/libvirt-override-api.xml
439+++ b/libvirt-override-api.xml
440@@ -834,5 +834,11 @@
441 <arg name='keys' type='char *' info='optional list of authorized keys to set/append/remove'/>
442 <arg name='flags' type='int' info='optional OR&apos;ed set of virDomainAuthorizedSSHKeysSetFlags'/>
443 </function>
444+ <function name='virDomainGetMessages' file='python'>
445+ <info>Fetch list of messages reported against domain.</info>
446+ <return type='char *' info='list of messages'/>
447+ <arg name='domain' type='virDomainPtr' info='a domain object'/>
448+ <arg name='flags' type='unsigned int' info='optional fine-tuning flags'/>
449+ </function>
450 </symbols>
451 </api>
452diff --git a/libvirt-override.c b/libvirt-override.c
453index d9eee28..65319ee 100644
454--- a/libvirt-override.c
455+++ b/libvirt-override.c
456@@ -1625,10 +1625,14 @@ libvirt_virDomainGetIOThreadInfo(PyObject *self ATTRIBUTE_UNUSED,
457 VIR_PY_TUPLE_SET_GOTO(iothrtpl, 1, iothrmap, cleanup);
458
459 for (pcpu = 0; pcpu < cpunum; pcpu++)
460- VIR_PY_LIST_SET_GOTO(iothrmap, pcpu,
461- PyBool_FromLong(VIR_CPU_USED(iothr->cpumap,
462- pcpu)),
463- cleanup);
464+ if (VIR_CPU_MAPLEN(pcpu + 1) > iothr->cpumaplen) {
465+ VIR_PY_LIST_SET_GOTO(iothrmap, pcpu, PyBool_FromLong(0), cleanup);
466+ } else {
467+ VIR_PY_LIST_SET_GOTO(iothrmap, pcpu,
468+ PyBool_FromLong(VIR_CPU_USED(iothr->cpumap,
469+ pcpu)),
470+ cleanup);
471+ }
472 }
473
474 py_retval = py_iothrinfo;
475@@ -7232,7 +7236,7 @@ libvirt_virConnectDomainEventBlockThresholdCallback(virConnectPtr conn ATTRIBUTE
476 /* Call the Callback Dispatcher */
477 pyobj_ret = PyObject_CallMethod(pyobj_conn,
478 (char*)"_dispatchDomainEventBlockThresholdCallback",
479- (char*)"OssiiO",
480+ (char*)"OssKKO",
481 pyobj_dom, dev, path, threshold, excess,
482 pyobj_cbData);
483
484@@ -10514,6 +10518,49 @@ libvirt_virDomainAuthorizedSSHKeysSet(PyObject *self ATTRIBUTE_UNUSED,
485 }
486 #endif /* LIBVIR_CHECK_VERSION(6, 10, 0) */
487
488+#if LIBVIR_CHECK_VERSION(7, 1, 0)
489+static PyObject *
490+libvirt_virDomainGetMessages(PyObject *self ATTRIBUTE_UNUSED,
491+ PyObject *args)
492+{
493+ PyObject *pyobj_dom = NULL;
494+ virDomainPtr dom = NULL;
495+ char **msgs = NULL;
496+ int nmsgs;
497+ int i;
498+ unsigned int flags;
499+ PyObject *ret = NULL;
500+
501+ if (!PyArg_ParseTuple(args, (char *)"OI:virDomainGetMessages",
502+ &pyobj_dom, &flags))
503+ return NULL;
504+ dom = (virDomainPtr) PyvirDomain_Get(pyobj_dom);
505+
506+ LIBVIRT_BEGIN_ALLOW_THREADS;
507+ nmsgs = virDomainGetMessages(dom, &msgs, flags);
508+ LIBVIRT_END_ALLOW_THREADS;
509+
510+ if (nmsgs < 0)
511+ return VIR_PY_NONE;
512+
513+ if ((ret = PyList_New(nmsgs)) == NULL)
514+ goto error;
515+
516+ for (i = 0; i < nmsgs; i++)
517+ VIR_PY_LIST_SET_GOTO(ret, i, libvirt_constcharPtrWrap(msgs[i]), error);
518+
519+ done:
520+ for (i = 0; i < nmsgs; i++)
521+ VIR_FREE(msgs[i]);
522+ VIR_FREE(msgs);
523+ return ret;
524+
525+ error:
526+ Py_CLEAR(ret);
527+ goto done;
528+}
529+#endif /* LIBVIR_CHECK_VERSION(7, 1, 0) */
530+
531
532 /************************************************************************
533 * *
534@@ -10783,6 +10830,9 @@ static PyMethodDef libvirtMethods[] = {
535 {(char *) "virDomainAuthorizedSSHKeysGet", libvirt_virDomainAuthorizedSSHKeysGet, METH_VARARGS, NULL},
536 {(char *) "virDomainAuthorizedSSHKeysSet", libvirt_virDomainAuthorizedSSHKeysSet, METH_VARARGS, NULL},
537 #endif /* LIBVIR_CHECK_VERSION(6, 10, 0) */
538+#if LIBVIR_CHECK_VERSION(7, 1, 0)
539+ {(char *) "virDomainGetMessages", libvirt_virDomainGetMessages, METH_VARARGS, NULL},
540+#endif /* LIBVIR_CHECK_VERSION(7, 1, 0) */
541 {NULL, NULL, 0, NULL}
542 };
543
544diff --git a/libvirt-python.spec b/libvirt-python.spec
545index 69d678b..0e2e05e 100644
546--- a/libvirt-python.spec
547+++ b/libvirt-python.spec
548@@ -14,18 +14,18 @@
549
550 Summary: The libvirt virtualization API python3 binding
551 Name: libvirt-python
552-Version: 7.0.0
553+Version: 7.6.0
554 Release: 1%{?dist}
555-Source0: http://libvirt.org/sources/python/%{name}-%{version}.tar.gz
556-Url: http://libvirt.org
557+Source0: https://libvirt.org/sources/python/%{name}-%{version}.tar.gz
558+Url: https://libvirt.org
559 License: LGPLv2+
560 BuildRequires: libvirt-devel == %{version}
561 BuildRequires: python3-devel
562 %if 0%{?rhel} == 7
563-BuildRequires: python36-nose
564+BuildRequires: python36-pytest
565 BuildRequires: python36-lxml
566 %else
567-BuildRequires: python3-nose
568+BuildRequires: python3-pytest
569 BuildRequires: python3-lxml
570 %endif
571 BuildRequires: gcc
572diff --git a/setup.py b/setup.py
573index a02535d..f4d8e3a 100755
574--- a/setup.py
575+++ b/setup.py
576@@ -55,12 +55,6 @@ def have_libvirt_lxc():
577 except DistutilsExecError:
578 return False
579
580-def have_libvirtaio():
581- # This depends on asyncio, which in turn depends on "yield from" syntax.
582- # The asyncio module itself is in standard library since 3.4, but there is
583- # an out-of-tree version compatible with 3.3.
584- return sys.version_info >= (3, 3)
585-
586 def get_pkgconfig_data(args, mod, required=True):
587 """Run pkg-config to and return content associated with it"""
588 f = os.popen("%s %s %s" % (get_pkgcfg(), " ".join(args), mod))
589@@ -135,8 +129,7 @@ def get_module_lists():
590 c_modules.append(modulelxc)
591 py_modules.append("libvirt_lxc")
592
593- if have_libvirtaio():
594- py_modules.append("libvirtaio")
595+ py_modules.append("libvirtaio")
596
597 return c_modules, py_modules
598
599@@ -155,8 +148,7 @@ class my_build(build):
600 self.spawn([sys.executable, "generator.py", "libvirt-qemu", apis[1]])
601 if have_libvirt_lxc():
602 self.spawn([sys.executable, "generator.py", "libvirt-lxc", apis[2]])
603- if have_libvirtaio():
604- shutil.copy('libvirtaio.py', 'build')
605+ shutil.copy('libvirtaio.py', 'build')
606
607 build.run(self)
608
609@@ -294,13 +286,13 @@ class my_test(Command):
610 self.build_platlib = os.path.join(self.build_base,
611 'lib' + plat_specifier)
612
613- def find_nosetests_path(self):
614+ def find_pytest_path(self):
615 binaries = [
616- "nosetests-%d.%d" % (sys.version_info[0],
617+ "pytest-%d.%d" % (sys.version_info[0],
618 sys.version_info[1]),
619- "nosetests-%d" % (sys.version_info[0]),
620- "nosetests%d" % (sys.version_info[0]),
621- "nosetests",
622+ "pytest-%d" % (sys.version_info[0]),
623+ "pytest%d" % (sys.version_info[0]),
624+ "pytest",
625 ]
626
627 for binary in binaries:
628@@ -308,7 +300,7 @@ class my_test(Command):
629 if path is not None:
630 return path
631
632- raise Exception("Cannot find any nosetests binary")
633+ raise Exception("Cannot find any pytest binary")
634
635 def run(self):
636 """
637@@ -321,9 +313,11 @@ class my_test(Command):
638 os.environ["PYTHONPATH"] = self.build_platlib + ":" + os.environ["PYTHONPATH"]
639 else:
640 os.environ["PYTHONPATH"] = self.build_platlib
641- self.spawn([sys.executable, "sanitytest.py", self.build_platlib, apis[0]])
642- nose = self.find_nosetests_path()
643- self.spawn([sys.executable, nose])
644+
645+ if "LIBVIRT_API_COVERAGE" in os.environ:
646+ self.spawn([sys.executable, "sanitytest.py", self.build_platlib, apis[0]])
647+ pytest = self.find_pytest_path()
648+ self.spawn([sys.executable, pytest])
649
650
651 class my_clean(clean):
652@@ -341,7 +335,7 @@ class my_clean(clean):
653 _c_modules, _py_modules = get_module_lists()
654
655 setup(name = 'libvirt-python',
656- version = '7.0.0',
657+ version = '7.6.0',
658 url = 'http://www.libvirt.org',
659 maintainer = 'Libvirt Maintainers',
660 maintainer_email = 'libvir-list@redhat.com',
661diff --git a/tests/test_conn.py b/tests/test_conn.py
662index 557384a..fa181b7 100644
663--- a/tests/test_conn.py
664+++ b/tests/test_conn.py
665@@ -14,9 +14,9 @@ class TestLibvirtConn(unittest.TestCase):
666
667 def testConnDomainList(self):
668 doms = self.conn.listAllDomains()
669- self.assertEquals(len(doms), 1)
670- self.assertEquals(type(doms[0]), libvirt.virDomain)
671- self.assertEquals(doms[0].name(), "test")
672+ self.assertEqual(len(doms), 1)
673+ self.assertEqual(type(doms[0]), libvirt.virDomain)
674+ self.assertEqual(doms[0].name(), "test")
675
676 class TestLibvirtConnAuth(unittest.TestCase):
677 connXML = """
678diff --git a/tests/test_domain.py b/tests/test_domain.py
679index 17fd7b3..e0cdec6 100644
680--- a/tests/test_domain.py
681+++ b/tests/test_domain.py
682@@ -13,7 +13,7 @@ class TestLibvirtDomain(unittest.TestCase):
683
684 def testDomainSchedParams(self):
685 params = self.dom.schedulerParameters()
686- self.assertEquals(len(params), 1)
687+ self.assertEqual(len(params), 1)
688 self.assertTrue("weight" in params)
689 params["weight"] = 100
690 self.dom.setSchedulerParameters(params)
691diff --git a/tox.ini b/tox.ini
692index de683b9..24c96c2 100644
693--- a/tox.ini
694+++ b/tox.ini
695@@ -4,7 +4,7 @@ envlist = py36,py37,py38
696 [testenv]
697 deps=
698 lxml
699- nose
700+ pytest
701 commands=
702 python sanitytest.py
703- nosetests
704+ pytest

Subscribers

People subscribed via source and target branches