Control: tags 997719 + patch
Control: tags 997719 + pending
Dear maintainer,
I've prepared an NMU for libvirt-python (versioned as 7.9.0-0.1) and
uploaded it to DELAYED/5. Please feel free to tell me if I
should delay it longer.
Regards.
SR
diff -Nru libvirt-python-7.0.0/AUTHORS libvirt-python-7.9.0/AUTHORS
--- libvirt-python-7.0.0/AUTHORS 2021-01-15 04:52:56.818376800 -0400
+++ libvirt-python-7.9.0/AUTHORS 2021-11-01 08:22:58.888680200 -0400
@@ -12,6 +12,7 @@
Adam Litke <[email protected]>
Alex Jia <[email protected]>
Andrea Bolognani <[email protected]>
+ Beraldo Leal <[email protected]>
Boris Fiuczynski <[email protected]>
Brian Rak <[email protected]>
Chris Lalancette <[email protected]>
@@ -41,6 +42,7 @@
Jim Meyering <[email protected]>
Jiri Denemark <[email protected]>
John Ferlan <[email protected]>
+ Jonathon Jongsma <[email protected]>
Jovanka Gulicoska <[email protected]>
Ján Tomko <[email protected]>
KAMEZAWA Hiroyuki <[email protected]>
@@ -75,6 +77,7 @@
Pradipta Kr. Banerjee <[email protected]>
Qiaowei Ren <[email protected]>
Radostin Stoyanov <[email protected]>
+ renlei4 <[email protected]>
Richard W.M. Jones <[email protected]>
Robie Basak <[email protected]>
Serge E. Hallyn <[email protected]>
@@ -87,6 +90,7 @@
Victor Stinner <[email protected]>
Viktor Mihajlovski <[email protected]>
Vincent Vanlaer <[email protected]>
+ w00506750 <[email protected]>
Wojtek Porczyk <[email protected]>
Wu Zongyong <[email protected]>
Xavier Fernandez <[email protected]>
diff -Nru libvirt-python-7.0.0/ChangeLog libvirt-python-7.9.0/ChangeLog
--- libvirt-python-7.0.0/ChangeLog 2021-01-15 04:52:56.868377000 -0400
+++ libvirt-python-7.9.0/ChangeLog 2021-11-01 08:22:58.915347000 -0400
@@ -1,3 +1,364 @@
+2021-10-08 Daniel P. Berrangé <[email protected]>
+
+ Add support for domain event for memory device size change
+
+
+2021-10-01 Jiri Denemark <[email protected]>
+
+ Post-release version bump to 7.9.0
+
+
+2021-09-24 Michal Privoznik <[email protected]>
+
+ sanitytest: Add virNetworkCreateXMLFlags() to list of name fixups
+ When checking whether each C API is exported to Python and vice
+ versa the sanitytest script is doing some name fixing. For
+ instance virNetworkCreateXML() is translated into
+ virConnect.networkCreateXML(). However, we have new C API on the
+ way: virNetworkCreateXMLFlags() which is not on the list for
+ these name fixups. Add it there.
+
+ Mind you, the python code generator works just fine because
+ generator.py:1082 compares just the prefix.
+
+
+
+2021-09-21 Jonathon Jongsma <[email protected]>
+
+ Don't mention email patch submission in README
+ Since patches are now submitted via gitlab merge requests, don't mention
+ mailing list patch submission in the README. Point to the CONTRIBUTING
+ file instead.
+
+
+
+2021-09-21 Jonathon Jongsma <[email protected]>
+
+ Update readme to mention pytest instead of nose
+ Commit a376a2ab switch from python-nose to python-pytest for tests, but
+ the README was not updated.
+
+
+
+2021-09-21 Jonathon Jongsma <[email protected]>
+
+ Add new autostart API for node devices
+ Provide a manual override for the virNodeDeviceGetAutostart() API
+ modeled on what's done for the network and storage APIs.
+
+
+
+2021-09-02 Daniel P. Berrangé <[email protected]>
+
+ ci: remove obsolete refresh script and documentation
+ We now use lcitool's manifest feature to generate files.
+
+
+
+2021-09-02 Daniel P. Berrangé <[email protected]>
+
+ ci: re-generate containers/gitlab config from manifest
+ This uses the command "lcitool manifest ci/manifest.yml" to re-generate
+ all existing dockerfiles and gitlab CI config.
+
+
+
+2021-09-02 Daniel P. Berrangé <[email protected]>
+
+ ci: define a CI manifest file
+ This is to be used with the command "lcitool manifest ci/manifest.yml"
+ to re-generate all existing dockerfiles and gitlab CI config.
+
+
+
+2021-09-01 Daniel P. Berrangé <[email protected]>
+
+ rpm: drop support for RHEL-7
+ We no longer support libvirt on this distro
+
+
+
+2021-09-01 Jiri Denemark <[email protected]>
+
+ Post-release version bump to 7.8.0
+
+
+2021-08-02 Jiri Denemark <[email protected]>
+
+ Post-release version bump to 7.7.0
+
+
+2021-07-27 Daniel P. Berrangé <[email protected]>
+
+ gitlab: use custom docker:dind image
+ The current docker:dind container has broken default seccomp filter that
+ results in clone3 being blocked, which in turn breaks Fedora 35 rawhide.
+
+ This custom image has a workaround that causes the seccomp filter to
+ return ENOSYS for clone3 instad of EPERM, thus triggering glibc to
+ fallback to clone correctly.
+
+
+
+2021-07-01 Jiri Denemark <[email protected]>
+
+ Post-release version bump to 7.6.0
+
+
+2021-06-25 Peter Krempa <[email protected]>
+
+ Fix BlockThreshold Callback argument conversion once more
+ The conversion was changed from "OssiiO" to "OssLLO". Unfortunately the
+ arguments are unsigned long long, where the proper coversion character
+ is 'K'.
+
+ Fixes: https://gitlab.com/libvirt/libvirt-python/-/merge_requests/40
+ Fixes: fd069ac85c8cf1593587dc9287a3d5eb6bd4bdb9
+ Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1976109
+
+
+2021-06-01 Jiri Denemark <[email protected]>
+
+ Post-release version bump to 7.5.0
+
+
+2021-05-27 w00506750 <[email protected]>
+
+ iothread: fix memory access out of bounds
+ When the 'pcpu' is larger then the last 'iothr->cpumap' bits,
+ set the list element to False to avoid out of bounds access
+ 'iothr->cpumap'.
+
+ Reviewed-by: Hogan Wang <[email protected]>
+
+
+2021-05-27 Jiri Denemark <[email protected]>
+
+ Post-release version bump to 7.4.0
+
+
+2021-05-25 Daniel P. Berrangé <[email protected]>
+
+ containers: refresh containers with latest libvirt-ci
+
+
+2021-05-25 Daniel P. Berrangé <[email protected]>
+
+ gitlab: don't set RPM variable on container job
+
+
+2021-05-25 Daniel P. Berrangé <[email protected]>
+
+ gitlab: add OpenSUSE Tumbleweed container and build
+
+
+2021-05-25 Daniel P. Berrangé <[email protected]>
+
+ gitlab: introduce Fedora 34 container and build
+
+
+2021-05-25 Daniel P. Berrangé <[email protected]>
+
+ gitlab: rename opensuse-152 to opensuse-leap-152
+
+
+2021-05-25 Daniel P. Berrangé <[email protected]>
+
+ gitlab: rename centos-stream to centos-stream-8
+
+
+2021-05-25 Daniel P. Berrangé <[email protected]>
+
+ gitlab: drop Fedora 32 container and build
+
+
+2021-05-25 Daniel P. Berrangé <[email protected]>
+
+ gitlab: drop centos-7 container and build
+
+
+2021-04-15 Michal Privoznik <[email protected]>
+
+ generator.py: Untangle virNodeDevice name fixup
+ The way that virNodeDevice method name fixup is written makes it
+ hard to find via grep (matching the virNodeDevice prefix and then
+ matching only the operation like "Get", "Lookup", ...). Expand
+ the string matching to match the pattern of other cases.
+
+
+
+2021-04-15 Michal Privoznik <[email protected]>
+
+ generator.py: Fix method names for new virNodeDevice*() APIs
+ In the 7.3.0 release we are going to have three new public APIs:
+
+ virNodeDeviceDefineXML()
+ virNodeDeviceUndefine()
+ virNodeDeviceCreate()
+
+ The first one is slightly problematic, because it takes
+ virConnectPtr argument and thus our generator wants to put its
+ wrapper under virConnect python class, which is correct, but
+ what's incorrect is the name it chooses for the method:
+ defineXML(). Such method already exists and wraps
+ virDomainDefineXML() around. Also, the name is rather confusing
+ anyway - it's missing the 'nodeDevice' prefix.
+
+ Fortunately, the fix is easy - add another case into nameFixup().
+
+ The story with virNodeDeviceCreate() is similar. Except, this time
+ the class in which the method was put is correct. But the name is
+ still wrong, because our generator matched 'virNodeDeviceCreate'
+ thinking it's the good old virNodeDeviceCreateXML() API and
+ "fixed" the name of the method to nodeDeviceCreate().
+
+ Luckily, virNodeDeviceUndefine() is just fine.
+
+
+
+2021-04-12 Ján Tomko <[email protected]>
+
+ spec: use pytest instead of nose
+
+
+2021-04-12 Daniel P. Berrangé <[email protected]>
+
+ rpm: use HTTPS for URLs
+
+
+2021-04-09 Daniel P. Berrangé <[email protected]>
+
+ Don't run sanity checks by default
+ The sanity check scripts verify that the binding covers all APIs in the
+ libvirt library/headers being built against. This is primarily there for
+ libvirt maintainers to identify when there are gaps in API coverage.
+
+ This is not something downstream consumers of libvirt-python should be
+ running themselves, so we shouldn't added it to tests by default.
+
+ In addition if people are working on branches or submitting merge
+ requests for python changes, we shouldn't block their work for failed
+ API coverage sanity tests, if the python binding otherwise builds fine
+ and passes regular unit tests.
+
+ Thus, we introduce a new gitlab job "api-coverage" with some conditions:
+
+ - If pushing to a branch, the job is treated as non-fatal
+ - For regular scheduled builds, it is mandatory
+ - Don't run in any other scenarios
+
+ This job uses the artifacts from the centos-8-git-build job and re-runs
+ the test suite, requesting the sanity tests to be run too.
+
+ This will achieve the result of letting us see missing API coverage
+ in nightly builds, without blocking other contributions.
+
+
+
+2021-04-07 Ján Tomko <[email protected]>
+
+ tests: use assertEqual instead of assertEquals
+ tests/test_conn.py:17: DeprecationWarning: Please use assertEqual instead.
+
+
+
+2021-04-07 Ján Tomko <[email protected]>
+
+ ci: refresh containers for nose->pytest switch
+ Matches libvirt-ci commit facd5d855c97bf5b127ff9bf245c8fdf514dd916
+
+
+
+2021-04-07 Ján Tomko <[email protected]>
+
+ setup: use pytest instead of nose to run the test suite
+ The software we use for running tests - nose - has been
+ deprecated in favor of nose2.
+
+ We don't use anything nose-specific, just unittest.TestCase,
+ which pytest can handle just fine.
+
+ Switch to using pytest, which we already use for libvirt-dbus.
+
+
+
+2021-04-07 Ján Tomko <[email protected]>
+
+ setup: drop have_libvirtaio
+ This function says we have libvirtaio on Python >= 3.3,
+ however we already mandate Python >= 3.5 at the start of the file.
+
+
+
+2021-04-07 Andrea Bolognani <[email protected]>
+
+ ci: Move dco job to sanity_checks stage
+ If the DCO check fails we still want the pipeline to fail, but
+ that doesn't mean there's no value in running the other jobs to
+ get a better picture.
+
+
+
+2021-04-07 Andrea Bolognani <[email protected]>
+
+ ci: Use 'extends' GitLab CI feature
+ This is the recommended way to use templates in job
+ definitions.
+
+
+
+2021-04-06 Ján Tomko <[email protected]>
+
+ ci: drop openSUSE leap 15.1 in favor of 15.2
+
+
+2021-04-06 Ján Tomko <[email protected]>
+
+ ci: refresh dockerfiles
+ Refresh to match libvirt-ci commit 94c25bde639eb31ff2071fb6abfd3d5c777f4ab2
+
+
+
+2021-04-01 Jiri Denemark <[email protected]>
+
+ Post-release version bump to 7.3.0
+
+
+2021-03-01 Jiri Denemark <[email protected]>
+
+ Post-release version bump to 7.2.0
+
+
+2021-03-01 renlei4 <[email protected]>
+
+ Fix wrong type for BlockThreshold Callback
+ type of threshold and excess are unsigned long long,
+ but PyObject_CallMethod incorrectly set it to int.
+
+ if threshold or excess greater than 0x7FFFFFFF(max int),
+ those variables will overflow.
+
+
+
+2021-02-15 Daniel P. Berrangé <[email protected]>
+
+ Add impl override for virDomainGetMessages
+
+
+2021-02-09 Beraldo Leal <[email protected]>
+
+ improving readme with requirements
+ When installing this library in a fresh system, some basic packages are
+ necessary to compile and run. This patch will add basic instructions
+ with some requirements to help new contributors and users.
+
+
+
+2021-01-15 Jiri Denemark <[email protected]>
+
+ Post-release version bump to 7.1.0
+
+
2020-12-15 Daniel P. Berrangé <[email protected]>
ci: refresh containers for CentOS-8 PowerTools repo rename
diff -Nru libvirt-python-7.0.0/debian/changelog libvirt-python-7.9.0/debian/changelog
--- libvirt-python-7.0.0/debian/changelog 2021-02-18 03:45:20.000000000 -0400
+++ libvirt-python-7.9.0/debian/changelog 2021-11-24 20:02:38.000000000 -0400
@@ -1,3 +1,11 @@
+libvirt-python (7.9.0-0.1) unstable; urgency=medium
+
+ * Non-maintainer upload.
+ * New upstream release
+ (Closes: #997719)
+
+ -- Stefano Rivera <[email protected]> Wed, 24 Nov 2021 20:02:38 -0400
+
libvirt-python (7.0.0-2) unstable; urgency=medium
* Upload to unstable
diff -Nru libvirt-python-7.0.0/examples/event-test.py libvirt-python-7.9.0/examples/event-test.py
--- libvirt-python-7.0.0/examples/event-test.py 2020-12-01 04:54:25.366521600 -0400
+++ libvirt-python-7.9.0/examples/event-test.py 2021-11-01 08:22:56.095336200 -0400
@@ -640,6 +640,10 @@
print("myDomainEventMemoryFailureCallback: Domain %s(%s) memory failure recipient %d action %d flags %d" % (
dom.name(), dom.ID(), recipient, action, flags))
+def myDomainEventMemoryDeviceSizeChangeCallback(conn: libvirt.virConnect, dom: libvirt.virDomain, recipient: int, action: int, flags: int, opaque: _T) -> None:
+ print("myDomainEventMemoryDeviceSizeChangeCallback: Domain %s(%s) memory device size change alias %s size %d" % (
+ dom.name(), dom.ID(), alias, size))
+
##########################################################################
# Network events
@@ -793,6 +797,7 @@
vc.domainEventRegisterAny(None, libvirt.VIR_DOMAIN_EVENT_ID_METADATA_CHANGE, myDomainEventMetadataChangeCallback, None),
vc.domainEventRegisterAny(None, libvirt.VIR_DOMAIN_EVENT_ID_BLOCK_THRESHOLD, myDomainEventBlockThresholdCallback, None),
vc.domainEventRegisterAny(None, libvirt.VIR_DOMAIN_EVENT_ID_MEMORY_FAILURE, myDomainEventMemoryFailureCallback, None),
+ vc.domainEventRegisterAny(None, libvirt.VIR_DOMAIN_EVENT_ID_MEMORY_DEVICE_SIZE_CHANGE, myDomainEventMemoryDeviceSizeChangeCallback, None),
]
netcallbacks = [
diff -Nru libvirt-python-7.0.0/generator.py libvirt-python-7.9.0/generator.py
--- libvirt-python-7.0.0/generator.py 2020-12-01 04:54:25.369855000 -0400
+++ libvirt-python-7.9.0/generator.py 2021-10-01 04:38:50.840980000 -0400
@@ -479,6 +479,8 @@
'virDomainGetGuestInfo',
'virDomainAuthorizedSSHKeysGet',
'virDomainAuthorizedSSHKeysSet',
+ 'virDomainGetMessages',
+ 'virNodeDeviceGetAutostart',
}
lxc_skip_impl = {
@@ -1236,13 +1238,16 @@
elif name[0:13] == "virStorageVol":
func = name[13:]
func = func[0:1].lower() + func[1:]
+ elif name[0:16] == "virNodeDeviceGet":
+ func = name[16].lower() + name[17:]
+ elif name[0:19] == "virNodeDeviceLookup":
+ func = name[3].lower() + name[4:]
+ elif name[0:22] == "virNodeDeviceCreateXML":
+ func = name[3].lower() + name[4:]
+ elif name[0:19] == "virNodeDeviceDefine":
+ func = name[3].lower() + name[4:]
elif name[0:13] == "virNodeDevice":
- if name[13:16] == "Get":
- func = name[16].lower() + name[17:]
- elif name[13:19] == "Lookup" or name[13:19] == "Create":
- func = name[3].lower() + name[4:]
- else:
- func = name[13].lower() + name[14:]
+ func = name[13].lower() + name[14:]
elif name[0:7] == "virNode":
func = name[7:]
func = func[0:1].lower() + func[1:]
diff -Nru libvirt-python-7.0.0/libvirt-override-api.xml libvirt-python-7.9.0/libvirt-override-api.xml
--- libvirt-python-7.0.0/libvirt-override-api.xml 2020-12-01 04:54:25.369855000 -0400
+++ libvirt-python-7.9.0/libvirt-override-api.xml 2021-10-01 04:38:50.840980000 -0400
@@ -194,6 +194,11 @@
<return type='int' info='the autostart flag, or None in case of error'/>
<arg name='pool' type='virStoragePoolPtr' info='a storage pool object'/>
</function>
+ <function name='virNodeDeviceGetAutostart' file='python'>
+ <info>Extract the autostart flag for a node device.</info>
+ <return type='int' info='the autostart flag, or None in case of error'/>
+ <arg name='dev' type='virNodeDevicePtr' info='a node device object'/>
+ </function>
<function name='virDomainBlockStats' file='python'>
<info>Extracts block device statistics for a domain</info>
<return type='char *' info='a tuple of statistics'/>
@@ -834,5 +839,11 @@
<arg name='keys' type='char *' info='optional list of authorized keys to set/append/remove'/>
<arg name='flags' type='int' info='optional OR'ed set of virDomainAuthorizedSSHKeysSetFlags'/>
</function>
+ <function name='virDomainGetMessages' file='python'>
+ <info>Fetch list of messages reported against domain.</info>
+ <return type='char *' info='list of messages'/>
+ <arg name='domain' type='virDomainPtr' info='a domain object'/>
+ <arg name='flags' type='unsigned int' info='optional fine-tuning flags'/>
+ </function>
</symbols>
</api>
diff -Nru libvirt-python-7.0.0/libvirt-override.c libvirt-python-7.9.0/libvirt-override.c
--- libvirt-python-7.0.0/libvirt-override.c 2021-01-15 04:52:53.748373000 -0400
+++ libvirt-python-7.9.0/libvirt-override.c 2021-11-01 08:22:56.095336200 -0400
@@ -1625,10 +1625,14 @@
VIR_PY_TUPLE_SET_GOTO(iothrtpl, 1, iothrmap, cleanup);
for (pcpu = 0; pcpu < cpunum; pcpu++)
- VIR_PY_LIST_SET_GOTO(iothrmap, pcpu,
- PyBool_FromLong(VIR_CPU_USED(iothr->cpumap,
- pcpu)),
- cleanup);
+ if (VIR_CPU_MAPLEN(pcpu + 1) > iothr->cpumaplen) {
+ VIR_PY_LIST_SET_GOTO(iothrmap, pcpu, PyBool_FromLong(0), cleanup);
+ } else {
+ VIR_PY_LIST_SET_GOTO(iothrmap, pcpu,
+ PyBool_FromLong(VIR_CPU_USED(iothr->cpumap,
+ pcpu)),
+ cleanup);
+ }
}
py_retval = py_iothrinfo;
@@ -3351,6 +3355,32 @@
return libvirt_intWrap(autostart);
}
+#if LIBVIR_CHECK_VERSION(7, 8, 0)
+static PyObject *
+libvirt_virNodeDeviceGetAutostart(PyObject *self ATTRIBUTE_UNUSED,
+ PyObject *args)
+{
+ int c_retval, autostart;
+ virNodeDevicePtr dev;
+ PyObject *pyobj_dev;
+
+ if (!PyArg_ParseTuple(args, (char *)"O:virNodeDeviceGetAutostart",
+ &pyobj_dev))
+ return NULL;
+
+ dev = (virNodeDevicePtr) PyvirNodeDevice_Get(pyobj_dev);
+
+ LIBVIRT_BEGIN_ALLOW_THREADS;
+ c_retval = virNodeDeviceGetAutostart(dev, &autostart);
+ LIBVIRT_END_ALLOW_THREADS;
+
+ if (c_retval < 0)
+ return VIR_PY_INT_FAIL;
+
+ return libvirt_intWrap(autostart);
+}
+#endif /* LIBVIR_CHECK_VERSION(7, 8, 0) */
+
static PyObject *
libvirt_virNodeGetCellsFreeMemory(PyObject *self ATTRIBUTE_UNUSED,
PyObject *args)
@@ -7232,7 +7262,7 @@
/* Call the Callback Dispatcher */
pyobj_ret = PyObject_CallMethod(pyobj_conn,
(char*)"_dispatchDomainEventBlockThresholdCallback",
- (char*)"OssiiO",
+ (char*)"OssKKO",
pyobj_dom, dev, path, threshold, excess,
pyobj_cbData);
@@ -7310,6 +7340,61 @@
#endif /* VIR_DOMAIN_EVENT_ID_MEMORY_FAILURE */
+#ifdef VIR_DOMAIN_EVENT_ID_MEMORY_DEVICE_SIZE_CHANGE
+static int
+libvirt_virConnectDomainEventMemoryDeviceSizeChangeCallback(virConnectPtr conn ATTRIBUTE_UNUSED,
+ virDomainPtr dom,
+ const char *alias,
+ unsigned long long size,
+ void *opaque)
+{
+ PyObject *pyobj_cbData = (PyObject*)opaque;
+ PyObject *pyobj_dom;
+ PyObject *pyobj_ret = NULL;
+ PyObject *pyobj_conn;
+ PyObject *dictKey;
+ int ret = -1;
+
+ LIBVIRT_ENSURE_THREAD_STATE;
+
+ if (!(dictKey = libvirt_constcharPtrWrap("conn")))
+ goto cleanup;
+ pyobj_conn = PyDict_GetItem(pyobj_cbData, dictKey);
+ Py_DECREF(dictKey);
+
+ /* Create a python instance of this virDomainPtr */
+ virDomainRef(dom);
+ if (!(pyobj_dom = libvirt_virDomainPtrWrap(dom))) {
+ virDomainFree(dom);
+ goto cleanup;
+ }
+ Py_INCREF(pyobj_cbData);
+
+ /* Call the Callback Dispatcher */
+ pyobj_ret = PyObject_CallMethod(pyobj_conn,
+ (char*)"_dispatchDomainEventMemoryDeviceSizeChangeCallback",
+ (char*)"OsKO",
+ pyobj_dom, alias, size,
+ pyobj_cbData);
+
+ Py_DECREF(pyobj_cbData);
+ Py_DECREF(pyobj_dom);
+
+ cleanup:
+ if (!pyobj_ret) {
+ DEBUG("%s - ret:%p\n", __FUNCTION__, pyobj_ret);
+ PyErr_Print();
+ } else {
+ Py_DECREF(pyobj_ret);
+ ret = 0;
+ }
+
+ LIBVIRT_RELEASE_THREAD_STATE;
+ return ret;
+}
+#endif /* VIR_DOMAIN_EVENT_ID_MEMORY_DEVICE_SIZE_CHANGE */
+
+
static PyObject *
libvirt_virConnectDomainEventRegisterAny(PyObject *self ATTRIBUTE_UNUSED,
PyObject *args)
@@ -7440,6 +7525,11 @@
cb = VIR_DOMAIN_EVENT_CALLBACK(libvirt_virConnectDomainEventMemoryFailureCallback);
break;
#endif /* VIR_DOMAIN_EVENT_ID_MEMORY_FAILURE */
+#ifdef VIR_DOMAIN_EVENT_ID_MEMORY_DEVICE_SIZE_CHANGE
+ case VIR_DOMAIN_EVENT_ID_MEMORY_DEVICE_SIZE_CHANGE:
+ cb = VIR_DOMAIN_EVENT_CALLBACK(libvirt_virConnectDomainEventMemoryDeviceSizeChangeCallback);
+ break;
+#endif /* VIR_DOMAIN_EVENT_ID_MEMORY_DEVICE_SIZE_CHANGE */
case VIR_DOMAIN_EVENT_ID_LAST:
break;
}
@@ -10514,6 +10604,49 @@
}
#endif /* LIBVIR_CHECK_VERSION(6, 10, 0) */
+#if LIBVIR_CHECK_VERSION(7, 1, 0)
+static PyObject *
+libvirt_virDomainGetMessages(PyObject *self ATTRIBUTE_UNUSED,
+ PyObject *args)
+{
+ PyObject *pyobj_dom = NULL;
+ virDomainPtr dom = NULL;
+ char **msgs = NULL;
+ int nmsgs;
+ int i;
+ unsigned int flags;
+ PyObject *ret = NULL;
+
+ if (!PyArg_ParseTuple(args, (char *)"OI:virDomainGetMessages",
+ &pyobj_dom, &flags))
+ return NULL;
+ dom = (virDomainPtr) PyvirDomain_Get(pyobj_dom);
+
+ LIBVIRT_BEGIN_ALLOW_THREADS;
+ nmsgs = virDomainGetMessages(dom, &msgs, flags);
+ LIBVIRT_END_ALLOW_THREADS;
+
+ if (nmsgs < 0)
+ return VIR_PY_NONE;
+
+ if ((ret = PyList_New(nmsgs)) == NULL)
+ goto error;
+
+ for (i = 0; i < nmsgs; i++)
+ VIR_PY_LIST_SET_GOTO(ret, i, libvirt_constcharPtrWrap(msgs[i]), error);
+
+ done:
+ for (i = 0; i < nmsgs; i++)
+ VIR_FREE(msgs[i]);
+ VIR_FREE(msgs);
+ return ret;
+
+ error:
+ Py_CLEAR(ret);
+ goto done;
+}
+#endif /* LIBVIR_CHECK_VERSION(7, 1, 0) */
+
/************************************************************************
* *
@@ -10783,6 +10916,12 @@
{(char *) "virDomainAuthorizedSSHKeysGet", libvirt_virDomainAuthorizedSSHKeysGet, METH_VARARGS, NULL},
{(char *) "virDomainAuthorizedSSHKeysSet", libvirt_virDomainAuthorizedSSHKeysSet, METH_VARARGS, NULL},
#endif /* LIBVIR_CHECK_VERSION(6, 10, 0) */
+#if LIBVIR_CHECK_VERSION(7, 1, 0)
+ {(char *) "virDomainGetMessages", libvirt_virDomainGetMessages, METH_VARARGS, NULL},
+#endif /* LIBVIR_CHECK_VERSION(7, 1, 0) */
+#if LIBVIR_CHECK_VERSION(7, 8, 0)
+ {(char *) "virNodeDeviceGetAutostart", libvirt_virNodeDeviceGetAutostart, METH_VARARGS, NULL},
+#endif /* LIBVIR_CHECK_VERSION(7, 8, 0) */
{NULL, NULL, 0, NULL}
};
diff -Nru libvirt-python-7.0.0/libvirt-override-virConnect.py libvirt-python-7.9.0/libvirt-override-virConnect.py
--- libvirt-python-7.0.0/libvirt-override-virConnect.py 2020-12-01 04:54:25.369855000 -0400
+++ libvirt-python-7.9.0/libvirt-override-virConnect.py 2021-11-01 08:22:56.095336200 -0400
@@ -270,6 +270,15 @@
cb(self, virDomain(self, _obj=dom), recipient, action, flags, opaque)
return 0
+ def _dispatchDomainEventMemoryDeviceSizeChangeCallback(self, dom: 'virDomain', alias: str, size: int, cbData: Dict[str, Any]) -> int:
+ """Dispatches event to python user domain memory device size change event callbacks
+ """
+ cb = cbData["cb"]
+ opaque = cbData["opaque"]
+
+ cb(self, virDomain(self, _obj=dom), alias, size, opaque)
+ return 0
+
def domainEventDeregisterAny(self, callbackID: int) -> None:
"""Removes a Domain Event Callback. De-registering for a
domain callback will disable delivery of this event type """
diff -Nru libvirt-python-7.0.0/libvirt-python.spec libvirt-python-7.9.0/libvirt-python.spec
--- libvirt-python-7.0.0/libvirt-python.spec 2021-01-15 04:52:56.791710100 -0400
+++ libvirt-python-7.9.0/libvirt-python.spec 2021-11-01 08:22:58.858680000 -0400
@@ -3,8 +3,8 @@
# This spec file assumes you are building on a Fedora or RHEL version
# that's still supported by the vendor. It may work on other distros
# or versions, but no effort will be made to ensure that going forward
-%define min_rhel 7
-%define min_fedora 29
+%define min_rhel 8
+%define min_fedora 33
%if (0%{?fedora} && 0%{?fedora} >= %{min_fedora}) || (0%{?rhel} && 0%{?rhel} >= %{min_rhel})
%define supported_platform 1
@@ -14,20 +14,15 @@
Summary: The libvirt virtualization API python3 binding
Name: libvirt-python
-Version: 7.0.0
+Version: 7.9.0
Release: 1%{?dist}
-Source0: http://libvirt.org/sources/python/%{name}-%{version}.tar.gz
-Url: http://libvirt.org
+Source0: https://libvirt.org/sources/python/%{name}-%{version}.tar.gz
+Url: https://libvirt.org
License: LGPLv2+
BuildRequires: libvirt-devel == %{version}
BuildRequires: python3-devel
-%if 0%{?rhel} == 7
-BuildRequires: python36-nose
-BuildRequires: python36-lxml
-%else
-BuildRequires: python3-nose
+BuildRequires: python3-pytest
BuildRequires: python3-lxml
-%endif
BuildRequires: gcc
# Don't want provides for python shared objects
@@ -68,18 +63,10 @@
exit 1
%endif
-%if 0%{?fedora} || 0%{?rhel} >= 8
%py3_build
-%else
-CFLAGS="$RPM_OPT_FLAGS" %{__python3} setup.py build
-%endif
%install
-%if 0%{?fedora} || 0%{?rhel} >= 8
%py3_install
-%else
-%{__python3} setup.py install --skip-build --root=%{buildroot}
-%endif
%check
%{__python3} setup.py test
diff -Nru libvirt-python-7.0.0/PKG-INFO libvirt-python-7.9.0/PKG-INFO
--- libvirt-python-7.0.0/PKG-INFO 2021-01-15 04:52:57.048377000 -0400
+++ libvirt-python-7.9.0/PKG-INFO 2021-11-01 08:22:59.015347500 -0400
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: libvirt-python
-Version: 7.0.0
+Version: 7.9.0
Summary: The libvirt virtualization API python binding
Home-page: http://www.libvirt.org
Author: Libvirt Maintainers
diff -Nru libvirt-python-7.0.0/README libvirt-python-7.9.0/README
--- libvirt-python-7.0.0/README 2020-12-01 04:54:25.366521600 -0400
+++ libvirt-python-7.9.0/README 2021-10-01 04:38:50.840980000 -0400
@@ -1,5 +1,5 @@
- Libvirt Python Binding README
- =============================
+Libvirt Python Binding README
+=============================
This package provides a python binding to the libvirt.so,
libvirt-qemu.so and libvirt-lxc.so library APIs.
@@ -10,6 +10,15 @@
This code is distributed under the terms of the LGPL version
2 or later.
+Requirements
+------------
+
+To build the libvirt python binary requires the GCC and pkg-config
+tools, and development headers for the libvirt and python libraries.
+
+Building and installing
+-----------------------
+
The module can be built by following the normal python module
build process
@@ -21,7 +30,7 @@
python setup.py build
python setup.py install --user
-If python-nose is installed, you can test the package with
+If python-pytest is installed, you can test the package with
python setup.py test
@@ -38,16 +47,5 @@
/path/to/libvirt/run python setup.py build
-Patches for this code should be sent to the main libvirt
-development mailing list
-
- http://libvirt.org/contact.html#email
-
-To send patches, it is strongly recommended to use the
-'git send-email' command.
-
-Make sure the mails mention that the patch is for the python
-binding. This can be done by setting a config parameter in the
-local git checkout
-
- git config format.subjectprefix "PATCH python"
+Patches for this code should be submitted as merge requests to the
+project page on gitlab. See CONTRIBUTING.rst for more information.
diff -Nru libvirt-python-7.0.0/sanitytest.py libvirt-python-7.9.0/sanitytest.py
--- libvirt-python-7.0.0/sanitytest.py 2020-12-01 04:54:25.373188300 -0400
+++ libvirt-python-7.9.0/sanitytest.py 2021-10-01 04:38:50.844312000 -0400
@@ -253,7 +253,8 @@
"LookupByMACString", "LookupByUsage", "LookupByVolume",
"LookupByTargetPath", "LookupSCSIHostByWWN", "LookupByPortDev",
"Restore", "RestoreFlags",
- "SaveImageDefineXML", "SaveImageGetXMLDesc", "DefineXMLFlags"]:
+ "SaveImageDefineXML", "SaveImageGetXMLDesc", "DefineXMLFlags",
+ "CreateXMLFlags"]:
if klass != "virDomain":
func = klass[3:] + func
diff -Nru libvirt-python-7.0.0/setup.py libvirt-python-7.9.0/setup.py
--- libvirt-python-7.0.0/setup.py 2020-12-01 10:44:28.099603700 -0400
+++ libvirt-python-7.9.0/setup.py 2021-11-01 08:22:56.095336200 -0400
@@ -55,12 +55,6 @@
except DistutilsExecError:
return False
-def have_libvirtaio():
- # This depends on asyncio, which in turn depends on "yield from" syntax.
- # The asyncio module itself is in standard library since 3.4, but there is
- # an out-of-tree version compatible with 3.3.
- return sys.version_info >= (3, 3)
-
def get_pkgconfig_data(args, mod, required=True):
"""Run pkg-config to and return content associated with it"""
f = os.popen("%s %s %s" % (get_pkgcfg(), " ".join(args), mod))
@@ -135,8 +129,7 @@
c_modules.append(modulelxc)
py_modules.append("libvirt_lxc")
- if have_libvirtaio():
- py_modules.append("libvirtaio")
+ py_modules.append("libvirtaio")
return c_modules, py_modules
@@ -155,8 +148,7 @@
self.spawn([sys.executable, "generator.py", "libvirt-qemu", apis[1]])
if have_libvirt_lxc():
self.spawn([sys.executable, "generator.py", "libvirt-lxc", apis[2]])
- if have_libvirtaio():
- shutil.copy('libvirtaio.py', 'build')
+ shutil.copy('libvirtaio.py', 'build')
build.run(self)
@@ -294,13 +286,13 @@
self.build_platlib = os.path.join(self.build_base,
'lib' + plat_specifier)
- def find_nosetests_path(self):
+ def find_pytest_path(self):
binaries = [
- "nosetests-%d.%d" % (sys.version_info[0],
+ "pytest-%d.%d" % (sys.version_info[0],
sys.version_info[1]),
- "nosetests-%d" % (sys.version_info[0]),
- "nosetests%d" % (sys.version_info[0]),
- "nosetests",
+ "pytest-%d" % (sys.version_info[0]),
+ "pytest%d" % (sys.version_info[0]),
+ "pytest",
]
for binary in binaries:
@@ -308,7 +300,7 @@
if path is not None:
return path
- raise Exception("Cannot find any nosetests binary")
+ raise Exception("Cannot find any pytest binary")
def run(self):
"""
@@ -321,9 +313,11 @@
os.environ["PYTHONPATH"] = self.build_platlib + ":" + os.environ["PYTHONPATH"]
else:
os.environ["PYTHONPATH"] = self.build_platlib
- self.spawn([sys.executable, "sanitytest.py", self.build_platlib, apis[0]])
- nose = self.find_nosetests_path()
- self.spawn([sys.executable, nose])
+
+ if "LIBVIRT_API_COVERAGE" in os.environ:
+ self.spawn([sys.executable, "sanitytest.py", self.build_platlib, apis[0]])
+ pytest = self.find_pytest_path()
+ self.spawn([sys.executable, pytest])
class my_clean(clean):
@@ -341,7 +335,7 @@
_c_modules, _py_modules = get_module_lists()
setup(name = 'libvirt-python',
- version = '7.0.0',
+ version = '7.9.0',
url = 'http://www.libvirt.org',
maintainer = 'Libvirt Maintainers',
maintainer_email = '[email protected]',
diff -Nru libvirt-python-7.0.0/tests/test_conn.py libvirt-python-7.9.0/tests/test_conn.py
--- libvirt-python-7.0.0/tests/test_conn.py 2020-12-01 04:54:25.373188300 -0400
+++ libvirt-python-7.9.0/tests/test_conn.py 2021-10-01 04:38:50.844312000 -0400
@@ -14,9 +14,9 @@
def testConnDomainList(self):
doms = self.conn.listAllDomains()
- self.assertEquals(len(doms), 1)
- self.assertEquals(type(doms[0]), libvirt.virDomain)
- self.assertEquals(doms[0].name(), "test")
+ self.assertEqual(len(doms), 1)
+ self.assertEqual(type(doms[0]), libvirt.virDomain)
+ self.assertEqual(doms[0].name(), "test")
class TestLibvirtConnAuth(unittest.TestCase):
connXML = """
diff -Nru libvirt-python-7.0.0/tests/test_domain.py libvirt-python-7.9.0/tests/test_domain.py
--- libvirt-python-7.0.0/tests/test_domain.py 2020-12-01 04:54:25.373188300 -0400
+++ libvirt-python-7.9.0/tests/test_domain.py 2021-10-01 04:38:50.844312000 -0400
@@ -13,7 +13,7 @@
def testDomainSchedParams(self):
params = self.dom.schedulerParameters()
- self.assertEquals(len(params), 1)
+ self.assertEqual(len(params), 1)
self.assertTrue("weight" in params)
params["weight"] = 100
self.dom.setSchedulerParameters(params)
diff -Nru libvirt-python-7.0.0/tox.ini libvirt-python-7.9.0/tox.ini
--- libvirt-python-7.0.0/tox.ini 2020-12-01 04:54:25.373188300 -0400
+++ libvirt-python-7.9.0/tox.ini 2021-10-01 04:38:50.844312000 -0400
@@ -4,7 +4,7 @@
[testenv]
deps=
lxml
- nose
+ pytest
commands=
python sanitytest.py
- nosetests
+ pytest