Hello community, here is the log from the commit of package libvirt-python for openSUSE:Factory checked in at 2014-06-10 14:39:14 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/libvirt-python (Old) and /work/SRC/openSUSE:Factory/.libvirt-python.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "libvirt-python" Changes: -------- --- /work/SRC/openSUSE:Factory/libvirt-python/libvirt-python.changes 2014-05-13 20:44:58.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.libvirt-python.new/libvirt-python.changes 2014-06-10 14:39:17.000000000 +0200 @@ -1,0 +2,6 @@ +Sun Jun 1 22:43:05 MDT 2014 - [email protected] + +- Update to 1.2.5 + - Add all new APIs and constants in libvirt 1.2.5 + +------------------------------------------------------------------- Old: ---- libvirt-python-1.2.4.tar.bz2 New: ---- libvirt-python-1.2.5.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ libvirt-python.spec ++++++ --- /var/tmp/diff_new_pack.zixoU3/_old 2014-06-10 14:39:18.000000000 +0200 +++ /var/tmp/diff_new_pack.zixoU3/_new 2014-06-10 14:39:18.000000000 +0200 @@ -18,7 +18,7 @@ Name: libvirt-python Url: http://libvirt.org/ -Version: 1.2.4 +Version: 1.2.5 Release: 0 Summary: Library providing a simple virtualization API License: LGPL-2.1+ ++++++ libvirt-python-1.2.4.tar.bz2 -> libvirt-python-1.2.5.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libvirt-python-1.2.4/AUTHORS new/libvirt-python-1.2.5/AUTHORS --- old/libvirt-python-1.2.4/AUTHORS 2014-05-04 08:52:45.000000000 +0200 +++ new/libvirt-python-1.2.5/AUTHORS 2014-06-02 03:55:34.000000000 +0200 @@ -441,6 +441,8 @@ Martin Kletzander <[email protected]> Martin Kletzander <[email protected]> Martin Kletzander <[email protected]> + Martin Kletzander <[email protected]> + Martin Kletzander <[email protected]> MATSUDA Daiki <[email protected]> MATSUDA Daiki <[email protected]> Matthias Bolte <[email protected]> @@ -462,6 +464,7 @@ Michal Privoznik <[email protected]> Michal Privoznik <[email protected]> Michal Privoznik <[email protected]> + Michal Privoznik <[email protected]> Miloslav Trmač <[email protected]> Minoru Usui <[email protected]> Minoru Usui <[email protected]> @@ -530,6 +533,7 @@ Taku Izumi <[email protected]> Taku Izumi <[email protected]> Taku Izumi <[email protected]> + Tomoki Sekiyama <[email protected]> Viktor Mihajlovski <[email protected]> Viktor Mihajlovski <[email protected]> Viktor Mihajlovski <[email protected]> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libvirt-python-1.2.4/ChangeLog new/libvirt-python-1.2.5/ChangeLog --- old/libvirt-python-1.2.4/ChangeLog 2014-05-04 08:52:45.000000000 +0200 +++ new/libvirt-python-1.2.5/ChangeLog 2014-06-02 03:55:34.000000000 +0200 @@ -1,3 +1,44 @@ +2014-05-27 Martin Kletzander <[email protected]> + + fix leak in memoryStats with older python + libvirt_virDomainMemoryStats() function creates a dictionary without + any checks whether the additions were successful, whether the python + objects were created and, most importantly, without decrementing the + reference count on the objects added to the dictionary. This is + somehow not an issue with current upstream versions, however with + python 2.6 this exposes a leak in our bindings. The following patch + works on both old and new CPython versions and is already used in + other parts of the code, so it's also most straightforward. + + Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1099860 + + + +2014-05-20 Michal Privoznik <[email protected]> + + Implement virDomain{Get,Set}Time APIs + While the setter can be generated automatically, the getter is not. + However, it would be a lot easier if they both share the same logic: + a python dictionary to represent the time: dict['seconds'] to + represent seconds, and dict['nseconds'] to represent nanoseconds. + + + +2014-05-16 Tomoki Sekiyama <[email protected]> + + override: add virDomainFSFreeze and virDomainFSThaw API + Add binding for the new virDomainFSFreeze and virDomainFSThaw functions + added in libvirt 1.2.5. These require override since these take a list + of mountpoints path string. The methods are named 'fsFreeze' and + 'fsThaw'. + + + +2014-05-05 Martin Kletzander <[email protected]> + + Bump version to 1.2.5 for new dev cycle + + 2014-04-07 Laine Stump <[email protected]> build: add BuildRequires for python-lxml and python3-lxml diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libvirt-python-1.2.4/PKG-INFO new/libvirt-python-1.2.5/PKG-INFO --- old/libvirt-python-1.2.4/PKG-INFO 2014-05-04 08:52:45.000000000 +0200 +++ new/libvirt-python-1.2.5/PKG-INFO 2014-06-02 03:55:35.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 1.0 Name: libvirt-python -Version: 1.2.4 +Version: 1.2.5 Summary: The libvirt virtualization API Home-page: http://www.libvirt.org Author: Libvirt Maintainers diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libvirt-python-1.2.4/generator.py new/libvirt-python-1.2.5/generator.py --- old/libvirt-python-1.2.4/generator.py 2014-03-29 14:15:37.000000000 +0100 +++ new/libvirt-python-1.2.5/generator.py 2014-06-02 03:54:49.000000000 +0200 @@ -517,6 +517,11 @@ 'virDomainCreateXMLWithFiles', # overridden in virConnect.py 'virDomainCreateWithFiles', # overridden in virDomain.py + 'virDomainFSFreeze', # overridden in virDomain.py + 'virDomainFSThaw', # overridden in virDomain.py + 'virDomainGetTime', # overridden in virDomain.py + 'virDomainSetTime', # overridden in virDomain.py + # 'Ref' functions have no use for bindings users. "virConnectRef", "virDomainRef", diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libvirt-python-1.2.4/libvirt-override-virDomain.py new/libvirt-python-1.2.5/libvirt-override-virDomain.py --- old/libvirt-python-1.2.4/libvirt-override-virDomain.py 2013-11-28 04:41:59.000000000 +0100 +++ new/libvirt-python-1.2.5/libvirt-override-virDomain.py 2014-06-02 03:54:49.000000000 +0200 @@ -47,3 +47,28 @@ ret = libvirtmod.virDomainCreateWithFiles(self._o, files, flags) if ret == -1: raise libvirtError ('virDomainCreateWithFiles() failed', dom=self) return ret + + def fsFreeze(self, mountpoints=None, flags=0): + """Freeze specified filesystems within the guest """ + ret = libvirtmod.virDomainFSFreeze(self._o, mountpoints, flags) + if ret == -1: raise libvirtError ('virDomainFSFreeze() failed', dom=self) + return ret + + def fsThaw(self, mountpoints=None, flags=0): + """Thaw specified filesystems within the guest """ + ret = libvirtmod.virDomainFSThaw(self._o, mountpoints, flags) + if ret == -1: raise libvirtError ('virDomainFSThaw() failed', dom=self) + return ret + + def getTime(self, flags=0): + """Extract information about guest time """ + ret = libvirtmod.virDomainGetTime(self._o, flags) + if ret == -1: raise libvirtError ('virDomainGetTime() failed', dom=self) + return ret + + def setTime(self, time=None, flags=0): + """Set guest time to the given value. @time is a dict conatining + 'seconds' field for seconds and 'nseconds' field for nanosecons """ + ret = libvirtmod.virDomainSetTime(self._o, time, flags) + if ret == -1: raise libvirtError ('virDomainSetTime() failed', dom=self) + return ret diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libvirt-python-1.2.4/libvirt-override.c new/libvirt-python-1.2.5/libvirt-override.c --- old/libvirt-python-1.2.4/libvirt-override.c 2014-04-01 09:38:24.000000000 +0200 +++ new/libvirt-python-1.2.5/libvirt-override.c 2014-06-02 03:54:49.000000000 +0200 @@ -734,6 +734,7 @@ size_t i; virDomainMemoryStatStruct stats[VIR_DOMAIN_MEMORY_STAT_NR]; PyObject *info; + PyObject *key = NULL, *val = NULL; if (!PyArg_ParseTuple(args, (char *)"O:virDomainMemoryStats", &pyobj_domain)) return NULL; @@ -749,31 +750,50 @@ return VIR_PY_NONE; for (i = 0; i < nr_stats; i++) { - if (stats[i].tag == VIR_DOMAIN_MEMORY_STAT_SWAP_IN) - PyDict_SetItem(info, libvirt_constcharPtrWrap("swap_in"), - libvirt_ulonglongWrap(stats[i].val)); - else if (stats[i].tag == VIR_DOMAIN_MEMORY_STAT_SWAP_OUT) - PyDict_SetItem(info, libvirt_constcharPtrWrap("swap_out"), - libvirt_ulonglongWrap(stats[i].val)); - else if (stats[i].tag == VIR_DOMAIN_MEMORY_STAT_MAJOR_FAULT) - PyDict_SetItem(info, libvirt_constcharPtrWrap("major_fault"), - libvirt_ulonglongWrap(stats[i].val)); - else if (stats[i].tag == VIR_DOMAIN_MEMORY_STAT_MINOR_FAULT) - PyDict_SetItem(info, libvirt_constcharPtrWrap("minor_fault"), - libvirt_ulonglongWrap(stats[i].val)); - else if (stats[i].tag == VIR_DOMAIN_MEMORY_STAT_UNUSED) - PyDict_SetItem(info, libvirt_constcharPtrWrap("unused"), - libvirt_ulonglongWrap(stats[i].val)); - else if (stats[i].tag == VIR_DOMAIN_MEMORY_STAT_AVAILABLE) - PyDict_SetItem(info, libvirt_constcharPtrWrap("available"), - libvirt_ulonglongWrap(stats[i].val)); - else if (stats[i].tag == VIR_DOMAIN_MEMORY_STAT_ACTUAL_BALLOON) - PyDict_SetItem(info, libvirt_constcharPtrWrap("actual"), - libvirt_ulonglongWrap(stats[i].val)); - else if (stats[i].tag == VIR_DOMAIN_MEMORY_STAT_RSS) - PyDict_SetItem(info, libvirt_constcharPtrWrap("rss"), - libvirt_ulonglongWrap(stats[i].val)); + switch (stats[i].tag) { + case VIR_DOMAIN_MEMORY_STAT_SWAP_IN: + key = libvirt_constcharPtrWrap("swap_in"); + break; + case VIR_DOMAIN_MEMORY_STAT_SWAP_OUT: + key = libvirt_constcharPtrWrap("swap_out"); + break; + case VIR_DOMAIN_MEMORY_STAT_MAJOR_FAULT: + key = libvirt_constcharPtrWrap("major_fault"); + break; + case VIR_DOMAIN_MEMORY_STAT_MINOR_FAULT: + key = libvirt_constcharPtrWrap("minor_fault"); + break; + case VIR_DOMAIN_MEMORY_STAT_UNUSED: + key = libvirt_constcharPtrWrap("unused"); + break; + case VIR_DOMAIN_MEMORY_STAT_AVAILABLE: + key = libvirt_constcharPtrWrap("available"); + break; + case VIR_DOMAIN_MEMORY_STAT_ACTUAL_BALLOON: + key = libvirt_constcharPtrWrap("actual"); + break; + case VIR_DOMAIN_MEMORY_STAT_RSS: + key = libvirt_constcharPtrWrap("rss"); + break; + default: + continue; + } + val = libvirt_ulonglongWrap(stats[i].val); + + if (!key || !val || PyDict_SetItem(info, key, val) < 0) { + Py_DECREF(info); + info = NULL; + goto cleanup; + } + Py_DECREF(key); + Py_DECREF(val); + key = NULL; + val = NULL; } + + cleanup: + Py_XDECREF(key); + Py_XDECREF(val); return info; } @@ -7554,6 +7574,192 @@ #endif /* LIBVIR_CHECK_VERSION(1, 1, 1) */ +#if LIBVIR_CHECK_VERSION(1, 2, 5) +static PyObject * +libvirt_virDomainFSFreeze(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) { + PyObject *py_retval = NULL; + int c_retval; + virDomainPtr domain; + PyObject *pyobj_domain; + PyObject *pyobj_list; + unsigned int flags; + unsigned int nmountpoints = 0; + char **mountpoints = NULL; + size_t i = 0, j; + + if (!PyArg_ParseTuple(args, (char *)"OOi:virDomainFSFreeze", + &pyobj_domain, &pyobj_list, &flags)) + return NULL; + domain = (virDomainPtr) PyvirDomain_Get(pyobj_domain); + + if (PyList_Check(pyobj_list)) { + nmountpoints = PyList_Size(pyobj_list); + + if (VIR_ALLOC_N(mountpoints, nmountpoints) < 0) + return PyErr_NoMemory(); + + for (i = 0; i < nmountpoints; i++) { + if (libvirt_charPtrUnwrap(PyList_GetItem(pyobj_list, i), + mountpoints+i) < 0 || + mountpoints[i] == NULL) + goto cleanup; + } + } + + LIBVIRT_BEGIN_ALLOW_THREADS; + c_retval = virDomainFSFreeze(domain, (const char **) mountpoints, + nmountpoints, flags); + LIBVIRT_END_ALLOW_THREADS; + + py_retval = libvirt_intWrap(c_retval); + +cleanup: + for (j = 0 ; j < i ; j++) + VIR_FREE(mountpoints[j]); + VIR_FREE(mountpoints); + return py_retval; +} + + +static PyObject * +libvirt_virDomainFSThaw(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) { + PyObject *py_retval = NULL; + int c_retval; + virDomainPtr domain; + PyObject *pyobj_domain; + PyObject *pyobj_list; + unsigned int flags; + unsigned int nmountpoints = 0; + char **mountpoints = NULL; + size_t i = 0, j; + + if (!PyArg_ParseTuple(args, (char *)"OOi:virDomainFSThaw", + &pyobj_domain, &pyobj_list, &flags)) + return NULL; + domain = (virDomainPtr) PyvirDomain_Get(pyobj_domain); + + if (PyList_Check(pyobj_list)) { + nmountpoints = PyList_Size(pyobj_list); + + if (VIR_ALLOC_N(mountpoints, nmountpoints) < 0) + return PyErr_NoMemory(); + + for (i = 0; i < nmountpoints; i++) { + if (libvirt_charPtrUnwrap(PyList_GetItem(pyobj_list, i), + mountpoints+i) < 0 || + mountpoints[i] == NULL) + goto cleanup; + } + } + + LIBVIRT_BEGIN_ALLOW_THREADS; + c_retval = virDomainFSThaw(domain, (const char **) mountpoints, + nmountpoints, flags); + LIBVIRT_END_ALLOW_THREADS; + + py_retval = libvirt_intWrap(c_retval); + + cleanup: + for (j = 0 ; j < i ; j++) + VIR_FREE(mountpoints[j]); + VIR_FREE(mountpoints); + return py_retval; +} + +static PyObject * +libvirt_virDomainGetTime(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) { + PyObject *py_retval = NULL; + PyObject *dict = NULL; + PyObject *pyobj_domain, *pyobj_seconds, *pyobj_nseconds; + virDomainPtr domain; + long long seconds; + unsigned int nseconds; + unsigned int flags; + int c_retval; + + if (!PyArg_ParseTuple(args, (char*)"Oi:virDomainGetTime", + &pyobj_domain, &flags)) + return NULL; + domain = (virDomainPtr) PyvirDomain_Get(pyobj_domain); + + if (!(dict = PyDict_New())) + goto cleanup; + + LIBVIRT_BEGIN_ALLOW_THREADS; + c_retval = virDomainGetTime(domain, &seconds, &nseconds, flags); + LIBVIRT_END_ALLOW_THREADS; + + if (c_retval < 0) + goto cleanup; + + if (!(pyobj_seconds = libvirt_longlongWrap(seconds)) || + PyDict_SetItemString(dict, "seconds", pyobj_seconds) < 0) + goto cleanup; + Py_DECREF(pyobj_seconds); + + if (!(pyobj_nseconds = libvirt_uintWrap(nseconds)) || + PyDict_SetItemString(dict, "nseconds", pyobj_nseconds) < 0) + goto cleanup; + Py_DECREF(pyobj_nseconds); + + py_retval = dict; + dict = NULL; + cleanup: + Py_XDECREF(dict); + return py_retval; +} + + +static PyObject * +libvirt_virDomainSetTime(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) { + PyObject *py_retval = NULL; + PyObject *pyobj_domain; + PyObject *py_dict; + virDomainPtr domain; + long long seconds = 0; + unsigned int nseconds = 0; + unsigned int flags; + ssize_t py_dict_size; + int c_retval; + + if (!PyArg_ParseTuple(args, (char*)"OOi:virDomainSetTime", + &pyobj_domain, &py_dict, &flags)) + return NULL; + domain = (virDomainPtr) PyvirDomain_Get(pyobj_domain); + + py_dict_size = PyDict_Size(py_dict); + + if (py_dict_size == 2) { + PyObject *pyobj_seconds, *pyobj_nseconds; + + if (!(pyobj_seconds = PyDict_GetItemString(py_dict, "seconds")) || + (libvirt_longlongUnwrap(pyobj_seconds, &seconds) < 0)) { + PyErr_Format(PyExc_LookupError, "malformed or missing 'seconds'"); + goto cleanup; + } + + if (!(pyobj_nseconds = PyDict_GetItemString(py_dict, "nseconds")) || + (libvirt_uintUnwrap(pyobj_nseconds, &nseconds) < 0)) { + PyErr_Format(PyExc_LookupError, "malformed or missing 'nseconds'"); + goto cleanup; + } + } else if (py_dict_size > 0) { + PyErr_Format(PyExc_LookupError, "Dictionary must contain " + "'seconds' and 'nseconds'"); + goto cleanup; + } + + LIBVIRT_BEGIN_ALLOW_THREADS; + c_retval = virDomainSetTime(domain, seconds, nseconds, flags); + LIBVIRT_END_ALLOW_THREADS; + + py_retval = libvirt_intWrap(c_retval); + + cleanup: + return py_retval; +} +#endif /* LIBVIR_CHECK_VERSION(1, 2, 5) */ + /************************************************************************ * * * The registration stuff * @@ -7729,6 +7935,12 @@ {(char *) "virDomainCreateXMLWithFiles", libvirt_virDomainCreateXMLWithFiles, METH_VARARGS, NULL}, {(char *) "virDomainCreateWithFiles", libvirt_virDomainCreateWithFiles, METH_VARARGS, NULL}, #endif /* LIBVIR_CHECK_VERSION(1, 1, 1) */ +#if LIBVIR_CHECK_VERSION(1, 2, 5) + {(char *) "virDomainFSFreeze", libvirt_virDomainFSFreeze, METH_VARARGS, NULL}, + {(char *) "virDomainFSThaw", libvirt_virDomainFSThaw, METH_VARARGS, NULL}, + {(char *) "virDomainGetTime", libvirt_virDomainGetTime, METH_VARARGS, NULL}, + {(char *) "virDomainSetTime", libvirt_virDomainSetTime, METH_VARARGS, NULL}, +#endif /* LIBVIR_CHECK_VERSION(1, 2, 5) */ {NULL, NULL, 0, NULL} }; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libvirt-python-1.2.4/libvirt-python.spec new/libvirt-python-1.2.5/libvirt-python.spec --- old/libvirt-python-1.2.4/libvirt-python.spec 2014-05-04 08:52:45.000000000 +0200 +++ new/libvirt-python-1.2.5/libvirt-python.spec 2014-06-02 03:55:34.000000000 +0200 @@ -6,7 +6,7 @@ Summary: The libvirt virtualization API python2 binding Name: libvirt-python -Version: 1.2.4 +Version: 1.2.5 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-1.2.4/sanitytest.py new/libvirt-python-1.2.5/sanitytest.py --- old/libvirt-python-1.2.4/sanitytest.py 2014-01-08 04:12:49.000000000 +0100 +++ new/libvirt-python-1.2.5/sanitytest.py 2014-06-02 03:54:49.000000000 +0200 @@ -152,7 +152,7 @@ # and virDomainSnapshot namespaces which stupidly used a different # convention which we now can't fix without breaking API if func[0:3] == "Get" and klass not in ["virConnect", "virDomainSnapshot", "libvirt"]: - if func not in ["GetCPUStats"]: + if func not in ["GetCPUStats", "GetTime"]: func = func[3:] # The object creation and lookup APIs all have to get re-mapped @@ -207,6 +207,8 @@ func = func[0:1].lower() + func[1:] if func[0:8] == "nWFilter": func = "nwfilter" + func[8:] + if func[0:8] == "fSFreeze" or func[0:6] == "fSThaw": + func = "fs" + func[2:] # ...except when they don't. More stupid naming # decisions we can't fix diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libvirt-python-1.2.4/setup.py new/libvirt-python-1.2.5/setup.py --- old/libvirt-python-1.2.4/setup.py 2014-05-04 08:51:16.000000000 +0200 +++ new/libvirt-python-1.2.5/setup.py 2014-06-02 03:54:49.000000000 +0200 @@ -309,7 +309,7 @@ _c_modules, _py_modules = get_module_lists() setup(name = 'libvirt-python', - version = '1.2.4', + version = '1.2.5', url = 'http://www.libvirt.org', maintainer = 'Libvirt Maintainers', maintainer_email = '[email protected]', -- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
