Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-libvirt-python for openSUSE:Factory checked in at 2023-10-04 22:30:27 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-libvirt-python (Old) and /work/SRC/openSUSE:Factory/.python-libvirt-python.new.28202 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-libvirt-python" Wed Oct 4 22:30:27 2023 rev:73 rq:1114876 version:9.8.0 Changes: -------- --- /work/SRC/openSUSE:Factory/python-libvirt-python/python-libvirt-python.changes 2023-09-10 13:10:25.230962271 +0200 +++ /work/SRC/openSUSE:Factory/.python-libvirt-python.new.28202/python-libvirt-python.changes 2023-10-04 22:30:41.429990946 +0200 @@ -1,0 +2,7 @@ +Mon Oct 2 17:44:28 UTC 2023 - James Fehlig <jfeh...@suse.com> + +- Update to 9.8.0 + - Add all new APIs and constants in libvirt 9.8.0 + - jsc#PED-3279 + +------------------------------------------------------------------- Old: ---- libvirt-python-9.7.0.tar.gz New: ---- libvirt-python-9.8.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-libvirt-python.spec ++++++ --- /var/tmp/diff_new_pack.nLfdj0/_old 2023-10-04 22:30:42.518030271 +0200 +++ /var/tmp/diff_new_pack.nLfdj0/_new 2023-10-04 22:30:42.518030271 +0200 @@ -24,7 +24,7 @@ %{?sle15_python_module_pythons} Name: python-libvirt-python URL: https://libvirt.org/ -Version: 9.7.0 +Version: 9.8.0 Release: 0 Summary: Library providing a virtualization API License: LGPL-2.1-or-later ++++++ _service ++++++ --- /var/tmp/diff_new_pack.nLfdj0/_old 2023-10-04 22:30:42.546031283 +0200 +++ /var/tmp/diff_new_pack.nLfdj0/_new 2023-10-04 22:30:42.550031428 +0200 @@ -1,7 +1,7 @@ <services> <service name="tar_scm" mode="disabled"> <param name="filename">libvirt-python</param> - <param name="revision">v9.7.0</param> + <param name="revision">v9.8.0</param> <param name="scm">git</param> <param name="submodules">disable</param> <param name="url">https://gitlab.com/libvirt/libvirt-python.git</param> ++++++ libvirt-python-9.7.0.tar.gz -> libvirt-python-9.8.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libvirt-python-9.7.0/.gitlab-ci.yml new/libvirt-python-9.8.0/.gitlab-ci.yml --- old/libvirt-python-9.7.0/.gitlab-ci.yml 2023-08-21 11:54:09.000000000 +0200 +++ new/libvirt-python-9.8.0/.gitlab-ci.yml 2023-09-25 13:17:31.000000000 +0200 @@ -30,6 +30,7 @@ - $PYTHON -m pytest tests - if test -x /usr/bin/rpmbuild && test "$RPM" != "skip" ; then + unset CFLAGS ; rpmbuild --clean --nodeps --define "_topdir $PWD/rpmbuild" -ta dist/libvirt-python*tar.gz ; mv rpmbuild/RPMS/x86_64/ libvirt-python-rpms ; fi @@ -53,6 +54,7 @@ - $PYTHON -m pytest tests - if test -x /usr/bin/rpmbuild && test "$RPM" != "skip" ; then + unset CFLAGS ; rpmbuild --clean --nodeps --define "_topdir $PWD/rpmbuild" -ta dist/libvirt-python*tar.gz ; mv rpmbuild/RPMS/x86_64/ libvirt-python-rpms ; fi diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libvirt-python-9.7.0/VERSION new/libvirt-python-9.8.0/VERSION --- old/libvirt-python-9.7.0/VERSION 2023-08-21 11:54:09.000000000 +0200 +++ new/libvirt-python-9.8.0/VERSION 2023-09-25 13:17:31.000000000 +0200 @@ -1 +1 @@ -9.7.0 +9.8.0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libvirt-python-9.7.0/examples/event-test.py new/libvirt-python-9.8.0/examples/event-test.py --- old/libvirt-python-9.7.0/examples/event-test.py 2023-08-21 11:54:09.000000000 +0200 +++ new/libvirt-python-9.8.0/examples/event-test.py 2023-09-25 13:17:31.000000000 +0200 @@ -664,6 +664,10 @@ print("myNetworkEventLifecycleCallback: Network %s %s %s" % ( net.name(), NET_EVENTS[event], NET_EVENTS[event][detail])) +def myNetworkEventMetadataChangeCallback(conn: libvirt.virConnect, dom: libvirt.virNetwork, mtype: int, nsuri: str, opaque: _T) -> None: + print("myNetworkEventMetadataChangeCallback: Network %s(%s) changed metadata mtype=%d nsuri=%s" % ( + dom.name(), dom.ID(), mtype, nsuri)) + ########################################################################## # Storage pool events @@ -806,6 +810,7 @@ netcallbacks = [ vc.networkEventRegisterAny(None, libvirt.VIR_NETWORK_EVENT_ID_LIFECYCLE, myNetworkEventLifecycleCallback, None), + vc.networkEventRegisterAny(None, libvirt.VIR_NETWORK_EVENT_ID_METADATA_CHANGE, myNetworkEventMetadataChangeCallback, None), ] poolcallbacks = [ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libvirt-python-9.7.0/generator.py new/libvirt-python-9.8.0/generator.py --- old/libvirt-python-9.7.0/generator.py 2023-08-21 11:54:09.000000000 +0200 +++ new/libvirt-python-9.8.0/generator.py 2023-09-25 13:17:31.000000000 +0200 @@ -881,6 +881,7 @@ wrapper = open(wrapper_file, "w") wrapper.write("/* Generated by generator.py */\n\n") + wrapper.write("#include <stdlib.h>\n") wrapper.write("#include <Python.h>\n") wrapper.write("#include <libvirt/%s.h>\n" % (module,)) wrapper.write("#include \"typewrappers.h\"\n") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libvirt-python-9.7.0/libvirt-override-virConnect.py new/libvirt-python-9.8.0/libvirt-override-virConnect.py --- old/libvirt-python-9.7.0/libvirt-override-virConnect.py 2023-08-21 11:54:09.000000000 +0200 +++ new/libvirt-python-9.8.0/libvirt-override-virConnect.py 2023-09-25 13:17:31.000000000 +0200 @@ -299,6 +299,15 @@ cb(self, virNetwork(self, _obj=net), event, detail, opaque) return 0 + def _dispatchNetworkEventMetadataChangeCallback(self, dom: 'virNetwork', mtype: int, nsuri: str, cbData: Dict[str, Any]) -> int: + """Dispatches event to python user network metadata change event callbacks + """ + cb = cbData["cb"] + opaque = cbData["opaque"] + + cb(self, virNetwork(self, _obj=dom), mtype, nsuri, opaque) + return 0 + def networkEventDeregisterAny(self, callbackID: int) -> None: """Removes a Network Event Callback. De-registering for a network callback will disable delivery of this event type""" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libvirt-python-9.7.0/libvirt-override.c new/libvirt-python-9.8.0/libvirt-override.c --- old/libvirt-python-9.7.0/libvirt-override.c 2023-08-21 11:54:09.000000000 +0200 +++ new/libvirt-python-9.8.0/libvirt-override.c 2023-09-25 13:17:31.000000000 +0200 @@ -18,6 +18,9 @@ #define VIR_ENUM_SENTINELS #define PY_SSIZE_T_CLEAN + +#include <stdio.h> +#include <string.h> #include <Python.h> #include <libvirt/libvirt.h> #include <libvirt/virterror.h> @@ -7649,6 +7652,59 @@ return ret; } +#ifdef VIR_NETWORK_EVENT_ID_METADATA_CHANGE +static int +libvirt_virConnectNetworkEventMetadataChangeCallback(virConnectPtr conn ATTRIBUTE_UNUSED, + virNetworkPtr dom, + int type, + const char *nsuri, + 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 virNetworkPtr */ + virNetworkRef(dom); + if (!(pyobj_dom = libvirt_virNetworkPtrWrap(dom))) { + virNetworkFree(dom); + goto cleanup; + } + Py_INCREF(pyobj_cbData); + + /* Call the Callback Dispatcher */ + pyobj_ret = PyObject_CallMethod(pyobj_conn, + (char*)"_dispatchNetworkEventMetadataChangeCallback", + (char*)"OisO", + pyobj_dom, type, nsuri, 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_NETWORK_EVENT_ID_METADATA_CHANGE */ + static PyObject * libvirt_virConnectNetworkEventRegisterAny(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) @@ -7680,6 +7736,12 @@ cb = VIR_NETWORK_EVENT_CALLBACK(libvirt_virConnectNetworkEventLifecycleCallback); break; +#ifdef VIR_NETWORK_EVENT_ID_METADATA_CHANGE + case VIR_NETWORK_EVENT_ID_METADATA_CHANGE: + cb = VIR_NETWORK_EVENT_CALLBACK(libvirt_virConnectNetworkEventMetadataChangeCallback); + break; +#endif /* VIR_NETWORK_EVENT_ID_METADATA_CHANGE */ + case VIR_NETWORK_EVENT_ID_LAST: break; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libvirt-python-9.7.0/libvirt-qemu-override.c new/libvirt-python-9.8.0/libvirt-qemu-override.c --- old/libvirt-python-9.7.0/libvirt-qemu-override.c 2023-08-21 11:54:09.000000000 +0200 +++ new/libvirt-python-9.8.0/libvirt-qemu-override.c 2023-09-25 13:17:31.000000000 +0200 @@ -14,6 +14,7 @@ which has over 180 autoconf-style HAVE_* definitions. Shame on them. */ #undef HAVE_PTHREAD_H +#include <stdio.h> #include <Python.h> #include <libvirt/libvirt-qemu.h> #include <libvirt/virterror.h> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libvirt-python-9.7.0/libvirt-utils.c new/libvirt-python-9.8.0/libvirt-utils.c --- old/libvirt-python-9.7.0/libvirt-utils.c 2023-08-21 11:54:09.000000000 +0200 +++ new/libvirt-python-9.8.0/libvirt-utils.c 2023-09-25 13:17:31.000000000 +0200 @@ -19,6 +19,8 @@ * */ +#include <string.h> + #include <Python.h> /* Ugly python defines that, which is also defined in errno.h */ @@ -532,7 +534,7 @@ Py_ssize_t i, size = PySequence_Size(value); for (i = 0; i < size; i++) { - PyObject *v = PySequence_ITEM(value, i); + PyObject *v = PySequence_GetItem(value, i); if (virPyDictToTypedParamOne(¶ms, &n, &max, hints, nhints, keystr, v) < 0) goto cleanup; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libvirt-python-9.7.0/setup.py new/libvirt-python-9.8.0/setup.py --- old/libvirt-python-9.7.0/setup.py 2023-08-21 11:54:09.000000000 +0200 +++ new/libvirt-python-9.8.0/setup.py 2023-09-25 13:17:31.000000000 +0200 @@ -50,14 +50,10 @@ def get_pkgconfig_data(args, mod, required=True): """Run pkg-config to and return content associated with it""" - cmd = ["pkg-config"] + args + [f"{mod}"] - with subprocess.Popen(cmd, - stdout=subprocess.PIPE, - stderr=subprocess.STDOUT, - universal_newlines=True) as p: - - line = p.stdout.readline() - if line is None or line == "": + cmd = ["pkg-config"] + args + [mod] + output = subprocess.check_output(cmd, universal_newlines=True) + for line in output.splitlines(): + if line == "": if required: args_str = " ".join(args) raise Exception(f"Cannot determine '{args_str}' from " @@ -91,6 +87,8 @@ ldflags = get_pkgconfig_data(["--libs-only-L"], "libvirt", False).split() cflags = get_pkgconfig_data(["--cflags"], "libvirt", False).split() + cflags += ["-Wp,-DPy_LIMITED_API=0x03060000"] + module = Extension("libvirtmod", sources=[ "libvirt-override.c", @@ -203,31 +201,21 @@ def gen_authors(self): - authors = [] - cmd = "git log --pretty=format:'%aN <%aE>'".split(" ") - with subprocess.Popen(cmd, - stdout=subprocess.PIPE, - stderr=subprocess.DEVNULL, - universal_newlines=True) as p: - for line in p.stdout: - line = " " + line.strip() - if line not in authors: - authors.append(line) - - authors.sort(key=str.lower) + cmd = ["git", "log", "--pretty=format:%aN <%aE>"] + output = subprocess.check_output(cmd, universal_newlines=True) + git_authors = {line.strip() for line in output.splitlines()} + authors = sorted(git_authors, key=str.lower) + authors = [" " + author for author in authors] self._gen_from_in("AUTHORS.in", "AUTHORS", "@AUTHORS@", "\n".join(authors)) def gen_changelog(self): - cmd = "git log '--pretty=format:%H:%ct %an <%ae>%n%n%s%n%b%n'".split(" ") - with open("ChangeLog", "w") as f_out, \ - subprocess.Popen(cmd, - stdout=subprocess.PIPE, - stderr=subprocess.DEVNULL, - universal_newlines=True) as p: - for line in p.stdout: + cmd = ["git", "log", "--pretty=format:%H:%ct %an <%ae>%n%n%s%n%b%n"] + with open("ChangeLog", "w") as f_out: + output = subprocess.check_output(cmd, universal_newlines=True) + for line in output.splitlines(): m = re.match(r"([a-f0-9]+):(\d+)\s(.*)", line) if m: t = time.gmtime(int(m.group(2))) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libvirt-python-9.7.0/typewrappers.c new/libvirt-python-9.8.0/typewrappers.c --- old/libvirt-python-9.7.0/typewrappers.c 2023-08-21 11:54:09.000000000 +0200 +++ new/libvirt-python-9.8.0/typewrappers.c 2023-09-25 13:17:31.000000000 +0200 @@ -12,6 +12,8 @@ * which has over 180 autoconf-style HAVE_* definitions. Shame on them. */ #undef HAVE_PTHREAD_H +#include <stdio.h> +#include <string.h> #include "typewrappers.h" #include "libvirt-utils.h"