Hello community, here is the log from the commit of package libvirt-python for openSUSE:Factory checked in at 2017-03-04 16:37:40 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/libvirt-python (Old) and /work/SRC/openSUSE:Factory/.libvirt-python.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "libvirt-python" Sat Mar 4 16:37:40 2017 rev:39 rq:476770 version:3.1.0 Changes: -------- --- /work/SRC/openSUSE:Factory/libvirt-python/libvirt-python.changes 2017-02-04 18:01:08.806711475 +0100 +++ /work/SRC/openSUSE:Factory/.libvirt-python.new/libvirt-python.changes 2017-03-04 16:48:22.580960990 +0100 @@ -1,0 +2,6 @@ +Fri Mar 3 15:06:02 UTC 2017 - [email protected] + +- Update to 3.1.0 + - Add all new APIs and constants in libvirt 3.1.0 + +------------------------------------------------------------------- Old: ---- libvirt-python-3.0.0.tar.gz libvirt-python-3.0.0.tar.gz.asc New: ---- libvirt-python-3.1.0.tar.gz libvirt-python-3.1.0.tar.gz.asc ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ libvirt-python.spec ++++++ --- /var/tmp/diff_new_pack.ewUIAp/_old 2017-03-04 16:48:23.032896998 +0100 +++ /var/tmp/diff_new_pack.ewUIAp/_new 2017-03-04 16:48:23.032896998 +0100 @@ -18,7 +18,7 @@ Name: libvirt-python Url: http://libvirt.org/ -Version: 3.0.0 +Version: 3.1.0 Release: 0 Summary: Library providing a simple virtualization API License: LGPL-2.1+ ++++++ libvirt-python-3.0.0.tar.gz -> libvirt-python-3.1.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libvirt-python-3.0.0/AUTHORS new/libvirt-python-3.1.0/AUTHORS --- old/libvirt-python-3.0.0/AUTHORS 2017-01-17 19:22:27.000000000 +0100 +++ new/libvirt-python-3.1.0/AUTHORS 2017-03-03 11:25:59.000000000 +0100 @@ -75,5 +75,6 @@ Tomoki Sekiyama <[email protected]> Victor Stinner <[email protected]> Viktor Mihajlovski <[email protected]> + Wu Zongyong <[email protected]> Zeeshan Ali (Khattak) <[email protected]> Zhou Yimin <[email protected]> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libvirt-python-3.0.0/ChangeLog new/libvirt-python-3.1.0/ChangeLog --- old/libvirt-python-3.0.0/ChangeLog 2017-01-17 19:22:27.000000000 +0100 +++ new/libvirt-python-3.1.0/ChangeLog 2017-03-03 11:25:59.000000000 +0100 @@ -1,3 +1,108 @@ +2017-01-27 Daniel P. Berrange <[email protected]> + + Removed unused 'functions_list_exception_test' code from generator + The 'functions_list_exception_test' data structure and associated code + in the generator is inherited from libxml. This has never + been used in libvirt, so delete it to simplify the generator. + + + +2017-01-27 Daniel P. Berrange <[email protected]> + + Removed unused 'converter_type' code from generator + The 'converter_type' data structure and associated code + in the generator is inherited from libxml. This has never + been used in libvirt, so delete it to simplify the generator. + + + +2017-01-27 Daniel P. Berrange <[email protected]> + + Removed unused 'classes_ancestor' code from generator + The 'classes_ancestor' data structure and associated code + in the generator is inherited from libxml. This has never + been used in libvirt, so delete it to simplify the generator. + + + +2017-01-27 Daniel P. Berrange <[email protected]> + + Removed unused 'py_return_types' code from generator + The 'py_return_types' data structure and associated code + in the generator is inherited from libxml. This has never + been used in libvirt, so delete it to simplify the generator. + + + +2017-01-27 Daniel P. Berrange <[email protected]> + + Removed unused 'foreign_encoding_args' code from generator + The 'foreign_encoding_args' data structure and associated code + in the generator is inherited from libxml. This has never + been used in libvirt, so delete it to simplify the generator. + + + +2017-01-27 Daniel P. Berrange <[email protected]> + + Removed unused 'function_post' code from generator + The 'function_post' data structure and associated code + in the generator is inherited from libxml. This has never + been used in libvirt, so delete it to simplify the generator. + + + +2017-01-27 Daniel P. Berrange <[email protected]> + + Removed unused 'reference_keepers' code from generator + The 'reference_keepers' data structure and associated code + in the generator is inherited from libxml. This has never + been used in libvirt, so delete it to simplify the generator. + + + +2017-01-27 Daniel P. Berrange <[email protected]> + + Protect against user accidentally calling constructors directly + When using libvirt python you must never call the object + constructors directly, as these are expecting to be passed + a wrapped C object. For example + + import libvirt + c = libvirt.virConnect("qemu:///system") + c.listAllDomains() + + will mysteriously segfault. With this change the user now + gets an slightly more helpful error + + Traceback (most recent call last): + File "<stdin>", line 1, in <module> + File "/home/berrange/src/virt/libvirt-python/build/libvirt.py", line 3409, in __init__ + raise Exception("Expected a wrapped C Object but got %s" % type(_obj)) + Exception: Expected a wrapped C Object but got <type 'str'> + + + +2017-01-18 Wu Zongyong <[email protected]> + + Fix the incorrect memory freeing which will result in crash + Commit id '71fd95409' neglected to adjust a couple of API's do that now. + + The number of elements in new_params is equal to the length of info, + instead of nparams, so it's wrong to free new_params using nparams. + + + +2017-01-18 John Ferlan <[email protected]> + + Post-release version bump to 3.1.0 + + +2017-01-17 Daniel Veillard <[email protected]> + + Release of libvirt-python-3.0.0 + + 2017-01-10 Michal Privoznik <[email protected]> examples: Update event-test.py diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libvirt-python-3.0.0/PKG-INFO new/libvirt-python-3.1.0/PKG-INFO --- old/libvirt-python-3.0.0/PKG-INFO 2017-01-17 19:22:27.000000000 +0100 +++ new/libvirt-python-3.1.0/PKG-INFO 2017-03-03 11:25:59.000000000 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: libvirt-python -Version: 3.0.0 +Version: 3.1.0 Summary: The libvirt virtualization API python binding Home-page: http://www.libvirt.org Author: Libvirt Maintainers diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libvirt-python-3.0.0/generator.py new/libvirt-python-3.1.0/generator.py --- old/libvirt-python-3.0.0/generator.py 2017-01-17 19:20:56.000000000 +0100 +++ new/libvirt-python-3.1.0/generator.py 2017-03-03 11:25:43.000000000 +0100 @@ -365,14 +365,8 @@ 'const virDomainSnapshot *': ('O', "virDomainSnapshot", "virDomainSnapshotPtr", "virDomainSnapshotPtr"), } -py_return_types = { -} - unknown_types = {} -foreign_encoding_args = ( -) - ####################################################################### # # This part writes the C <-> Python stubs libvirt.[ch] and @@ -693,8 +687,6 @@ c_args = c_args + " %s %s;\n" % (arg[1], arg[0]) if arg[1] in py_types: (f, t, n, c) = py_types[arg[1]] - if (f == 'z') and (name in foreign_encoding_args) and (num_bufs == 0): - f = 't#' if f is not None: format = format + f if t is not None: @@ -748,14 +740,6 @@ if n == "charPtr": ret_convert = ret_convert + " free(c_retval);\n" ret_convert = ret_convert + " return py_retval;\n" - elif ret[0] in py_return_types: - (f, t, n, c) = py_return_types[ret[0]] - c_return = " %s c_retval;\n" % (ret[0]) - c_call = "\n c_retval = %s(%s);\n" % (name, c_call) - ret_convert = " py_retval = libvirt_%sWrap((%s) c_retval);\n" % (n,c) - if n == "charPtr": - ret_convert = ret_convert + " free(c_retval);\n" - ret_convert = ret_convert + " return py_retval;\n" else: if ret[0] in skipped_types: return 0 @@ -868,7 +852,6 @@ def buildStubs(module, api_xml): global py_types - global py_return_types global unknown_types global onlyOverrides @@ -1026,17 +1009,11 @@ "virDomainSnapshot *": ("._o", "virDomainSnapshot(self, _obj=%s)", "virDomainSnapshot"), } -converter_type = { -} - primary_classes = ["virDomain", "virNetwork", "virInterface", "virStoragePool", "virStorageVol", "virConnect", "virNodeDevice", "virSecret", "virNWFilter", "virStream", "virDomainSnapshot"] -classes_ancestor = { -} - classes_destructors = { "virDomain": "virDomainFree", "virNetwork": "virNetworkFree", @@ -1074,15 +1051,10 @@ 'virNWFilterGetName': True, } -reference_keepers = { -} - function_classes = {} function_classes["None"] = [] -function_post = {} - # Functions returning an integral type which need special rules to # check for errors and raise exceptions. functions_int_exception_test = { @@ -1095,11 +1067,6 @@ def is_optional_arg(info): return re.search("^\(?optional\)?", info) is not None -# Functions returning lists which need special rules to check for errors -# and raise exceptions. -functions_list_exception_test = { -} -functions_list_default_test = "%s is None" def is_python_noninteger_type (name): @@ -1300,15 +1267,12 @@ def buildWrappers(module): global ctypes global py_types - global py_return_types global unknown_types global functions global function_classes global classes_type global classes_list global primary_classes - global classes_ancestor - global converter_type global classes_destructors global functions_noexcept @@ -1478,11 +1442,7 @@ elif is_python_noninteger_type (ret[0]): if name not in functions_noexcept: - if name in functions_list_exception_test: - test = functions_list_exception_test[name] - else: - test = functions_list_default_test - classes.write ((" if " + test + + classes.write ((" if %s is None" + ": raise libvirtError ('%s() failed')\n") % ("ret", name)) classes.write(" return ret\n") @@ -1496,43 +1456,29 @@ if classname == "None": pass else: - if classname in classes_ancestor: - classes.write("class %s(%s):\n" % (classname, - classes_ancestor[classname])) - classes.write(" def __init__(self, _obj=None):\n") - if classname in reference_keepers: - rlist = reference_keepers[classname] - for ref in rlist: - classes.write(" self.%s = None\n" % ref[1]) - classes.write(" self._o = _obj\n") - classes.write(" %s.__init__(self, _obj=_obj)\n\n" % ( - classes_ancestor[classname])) + classes.write("class %s(object):\n" % (classname)) + if classname in [ "virDomain", "virNetwork", "virInterface", "virStoragePool", + "virStorageVol", "virNodeDevice", "virSecret","virStream", + "virNWFilter" ]: + classes.write(" def __init__(self, conn, _obj=None):\n") + elif classname in [ 'virDomainSnapshot' ]: + classes.write(" def __init__(self, dom, _obj=None):\n") else: - classes.write("class %s(object):\n" % (classname)) - if classname in [ "virDomain", "virNetwork", "virInterface", "virStoragePool", - "virStorageVol", "virNodeDevice", "virSecret","virStream", - "virNWFilter" ]: - classes.write(" def __init__(self, conn, _obj=None):\n") - elif classname in [ 'virDomainSnapshot' ]: - classes.write(" def __init__(self, dom, _obj=None):\n") - else: - classes.write(" def __init__(self, _obj=None):\n") - if classname in reference_keepers: - rlist = reference_keepers[classname] - for ref in rlist: - classes.write(" self.%s = None\n" % ref[1]) - if classname in [ "virDomain", "virNetwork", "virInterface", - "virNodeDevice", "virSecret", "virStream", - "virNWFilter" ]: - classes.write(" self._conn = conn\n") - elif classname in [ "virStorageVol", "virStoragePool" ]: - classes.write(" self._conn = conn\n" + \ - " if not isinstance(conn, virConnect):\n" + \ - " self._conn = conn._conn\n") - elif classname in [ "virDomainSnapshot" ]: - classes.write(" self._dom = dom\n") - classes.write(" self._conn = dom.connect()\n") - classes.write(" self._o = _obj\n\n") + classes.write(" def __init__(self, _obj=None):\n") + if classname in [ "virDomain", "virNetwork", "virInterface", + "virNodeDevice", "virSecret", "virStream", + "virNWFilter" ]: + classes.write(" self._conn = conn\n") + elif classname in [ "virStorageVol", "virStoragePool" ]: + classes.write(" self._conn = conn\n" + \ + " if not isinstance(conn, virConnect):\n" + \ + " self._conn = conn._conn\n") + elif classname in [ "virDomainSnapshot" ]: + classes.write(" self._dom = dom\n") + classes.write(" self._conn = dom.connect()\n") + classes.write(" if type(_obj).__name__ not in [\"PyCapsule\", \"PyCObject\"]:\n") + classes.write(" raise Exception(\"Expected a wrapped C Object but got %s\" % type(_obj))\n") + classes.write(" self._o = _obj\n\n") destruct=None if classname in classes_destructors: classes.write(" def __del__(self):\n") @@ -1672,43 +1618,9 @@ classes.write("\n") # - # Sometime one need to keep references of the source - # class in the returned class object. - # See reference_keepers for the list - # - tclass = classes_type[ret[0]][2] - if tclass in reference_keepers: - rlist = reference_keepers[tclass] - for pref in rlist: - if pref[0] == classname: - classes.write(" __tmp.%s = self\n" % - pref[1]) - - # Post-processing - just before we return. - if name in function_post: - classes.write(" %s\n" % - (function_post[name])) - - # # return the class # classes.write(" return __tmp\n") - elif ret[0] in converter_type: - # - # Raise an exception - # - if name in functions_noexcept: - classes.write( - " if ret is None:return None") - - # Post-processing - just before we return. - if name in function_post: - classes.write(" %s\n" % - (function_post[name])) - - classes.write(" return ") - classes.write(converter_type[ret[0]] % ("ret")) - classes.write("\n") # For functions returning an integral type there # are several things that we can do, depending on @@ -1748,61 +1660,41 @@ ": raise libvirtError ('%s() failed')\n") % ("ret", name)) - # Post-processing - just before we return. - if name in function_post: - classes.write(" %s\n" % - (function_post[name])) - classes.write (" return ret\n") elif is_python_noninteger_type (ret[0]): if name not in functions_noexcept: - if name in functions_list_exception_test: - test = functions_list_exception_test[name] - else: - test = functions_list_default_test if classname == "virConnect": - classes.write ((" if " + test + + classes.write ((" if %s is None" + ": raise libvirtError ('%s() failed', conn=self)\n") % ("ret", name)) elif classname == "virDomain": - classes.write ((" if " + test + + classes.write ((" if %s is None" + ": raise libvirtError ('%s() failed', dom=self)\n") % ("ret", name)) elif classname == "virNetwork": - classes.write ((" if " + test + + classes.write ((" if %s is None" + ": raise libvirtError ('%s() failed', net=self)\n") % ("ret", name)) elif classname == "virInterface": - classes.write ((" if " + test + + classes.write ((" if %s is None" + ": raise libvirtError ('%s() failed', net=self)\n") % ("ret", name)) elif classname == "virStoragePool": - classes.write ((" if " + test + + classes.write ((" if %s is None" + ": raise libvirtError ('%s() failed', pool=self)\n") % ("ret", name)) elif classname == "virStorageVol": - classes.write ((" if " + test + + classes.write ((" if %s is None" + ": raise libvirtError ('%s() failed', vol=self)\n") % ("ret", name)) else: - classes.write ((" if " + test + + classes.write ((" if %s is None" + ": raise libvirtError ('%s() failed')\n") % ("ret", name)) - # Post-processing - just before we return. - if name in function_post: - classes.write(" %s\n" % - (function_post[name])) - classes.write (" return ret\n") - else: - # Post-processing - just before we return. - if name in function_post: - classes.write(" %s\n" % - (function_post[name])) - classes.write(" return ret\n") classes.write("\n") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libvirt-python-3.0.0/libvirt-override.c new/libvirt-python-3.1.0/libvirt-override.c --- old/libvirt-python-3.0.0/libvirt-override.c 2017-01-17 19:20:56.000000000 +0100 +++ new/libvirt-python-3.1.0/libvirt-override.c 2017-03-03 11:25:43.000000000 +0100 @@ -632,7 +632,7 @@ int nparams = 0; Py_ssize_t size = 0; unsigned int flags; - virTypedParameterPtr params, new_params = NULL; + virTypedParameterPtr params = NULL, new_params = NULL; if (!PyArg_ParseTuple(args, (char *)"OOI:virDomainSetScedulerParametersFlags", @@ -694,7 +694,7 @@ cleanup: virTypedParamsFree(params, nparams); - virTypedParamsFree(new_params, nparams); + virTypedParamsFree(new_params, size); return ret; } @@ -7739,7 +7739,7 @@ int nparams = 0; Py_ssize_t size = 0; unsigned int flags; - virTypedParameterPtr params, new_params = NULL; + virTypedParameterPtr params = NULL, new_params = NULL; if (!PyArg_ParseTuple(args, (char *)"OOI:virNodeSetMemoryParameters", @@ -7798,7 +7798,7 @@ cleanup: virTypedParamsFree(params, nparams); - virTypedParamsFree(new_params, nparams); + virTypedParamsFree(new_params, size); return ret; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libvirt-python-3.0.0/libvirt-python.spec new/libvirt-python-3.1.0/libvirt-python.spec --- old/libvirt-python-3.0.0/libvirt-python.spec 2017-01-17 19:22:27.000000000 +0100 +++ new/libvirt-python-3.1.0/libvirt-python.spec 2017-03-03 11:25:59.000000000 +0100 @@ -6,7 +6,7 @@ Summary: The libvirt virtualization API python2 binding Name: libvirt-python -Version: 3.0.0 +Version: 3.1.0 Release: 1%{?dist}%{?extra_release} Source0: http://libvirt.org/sources/python/%{name}-%{version}.tar.gz Url: http://libvirt.org diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libvirt-python-3.0.0/setup.py new/libvirt-python-3.1.0/setup.py --- old/libvirt-python-3.0.0/setup.py 2017-01-17 19:22:22.000000000 +0100 +++ new/libvirt-python-3.1.0/setup.py 2017-03-03 11:25:43.000000000 +0100 @@ -322,7 +322,7 @@ _c_modules, _py_modules = get_module_lists() setup(name = 'libvirt-python', - version = '3.0.0', + version = '3.1.0', url = 'http://www.libvirt.org', maintainer = 'Libvirt Maintainers', maintainer_email = '[email protected]',
