Hello community, here is the log from the commit of package libvirt-python for openSUSE:Factory checked in at 2017-06-10 17:51:46 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/libvirt-python (Old) and /work/SRC/openSUSE:Factory/.libvirt-python.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "libvirt-python" Sat Jun 10 17:51:46 2017 rev:42 rq:502727 version:3.4.0 Changes: -------- --- /work/SRC/openSUSE:Factory/libvirt-python/libvirt-python.changes 2017-05-09 18:09:52.215913160 +0200 +++ /work/SRC/openSUSE:Factory/.libvirt-python.new/libvirt-python.changes 2017-06-10 17:51:50.504704583 +0200 @@ -1,0 +2,6 @@ +Fri Jun 2 17:43:08 UTC 2017 - [email protected] + +- Update to 3.4.0 + - Add all new APIs and constants in libvirt 3.4.0 + +------------------------------------------------------------------- Old: ---- libvirt-python-3.3.0.tar.gz libvirt-python-3.3.0.tar.gz.asc New: ---- libvirt-python-3.4.0.tar.gz libvirt-python-3.4.0.tar.gz.asc ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ libvirt-python.spec ++++++ --- /var/tmp/diff_new_pack.8sK6Jw/_old 2017-06-10 17:51:51.048627782 +0200 +++ /var/tmp/diff_new_pack.8sK6Jw/_new 2017-06-10 17:51:51.052627217 +0200 @@ -18,7 +18,7 @@ Name: libvirt-python Url: http://libvirt.org/ -Version: 3.3.0 +Version: 3.4.0 Release: 0 Summary: Library providing a simple virtualization API License: LGPL-2.1+ ++++++ libvirt-python-3.3.0.tar.gz -> libvirt-python-3.4.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libvirt-python-3.3.0/AUTHORS new/libvirt-python-3.4.0/AUTHORS --- old/libvirt-python-3.3.0/AUTHORS 2017-05-05 21:48:18.000000000 +0200 +++ new/libvirt-python-3.4.0/AUTHORS 2017-06-02 09:04:21.000000000 +0200 @@ -77,5 +77,6 @@ Viktor Mihajlovski <[email protected]> Wojtek Porczyk <[email protected]> Wu Zongyong <[email protected]> + Xavier Fernandez <[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.3.0/ChangeLog new/libvirt-python-3.4.0/ChangeLog --- old/libvirt-python-3.3.0/ChangeLog 2017-05-05 21:48:18.000000000 +0200 +++ new/libvirt-python-3.4.0/ChangeLog 2017-06-02 09:04:21.000000000 +0200 @@ -1,3 +1,69 @@ +2017-05-24 Daniel P. Berrange <[email protected]> + + Fix error check for virDomainGetTime method + The virDomainGetTime returns either a dict or None, but the python + glue layer for checking for '-1'. Thus it failed to raise an + exception on error. + + + +2017-05-24 Michal Privoznik <[email protected]> + + examples: Introduce sparsestream.py + Sparse streams are not that straight forward to use for the very + first time. Especially the sparseRecvAll() and sparseSendAll() + methods which expects callbacks. What we can do to make it easier + for developers is to have an example where they can take an + inspiration from. + + + +2017-05-24 Michal Privoznik <[email protected]> + + virStream: Introduce virStreamSparse{Recv,Send}All + Yet again, our parser is not capable of generating proper + wrapper. To be fair, this one wold be really tough anyway. + + + +2017-05-23 Michal Privoznik <[email protected]> + + virStream: Introduce virStreamRecvFlags + Yet again, we need a custom wrapper over virStreamRecvFlags + because our generator is not capable of generating it. + + + +2017-05-23 Michal Privoznik <[email protected]> + + Implement virStreamSendHole/virStreamRecvHole + The return value for virStreamRecvHole is slightly different to + its C counterpart. In python, either it returns the hole size or + None if C API fails. + + + +2017-05-17 Xavier Fernandez <[email protected]> + + Use better comparison in virStream.sendAll for Python 3 + In Python 3, if the file is open in binary mode, @got will end up + being equal to b"" and b"" != "" in Python 3. + + +2017-05-15 Martin Kletzander <[email protected]> + + spec: Install egg-info with rpm package + This was being done due to now deprecated policy and that file should + be installed so that pip can recognize that the packages is already + installed in the system. + + + +2017-05-05 Daniel Veillard <[email protected]> + + Release of libvirt-python-3.3.0 + + 2017-04-04 Daniel P. Berrange <[email protected]> event-test: add ability to run the asyncio event loop diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libvirt-python-3.3.0/PKG-INFO new/libvirt-python-3.4.0/PKG-INFO --- old/libvirt-python-3.3.0/PKG-INFO 2017-05-05 21:48:18.000000000 +0200 +++ new/libvirt-python-3.4.0/PKG-INFO 2017-06-02 09:04:21.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: libvirt-python -Version: 3.3.0 +Version: 3.4.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.3.0/generator.py new/libvirt-python-3.4.0/generator.py --- old/libvirt-python-3.3.0/generator.py 2017-04-02 20:58:40.000000000 +0200 +++ new/libvirt-python-3.4.0/generator.py 2017-06-02 09:03:05.000000000 +0200 @@ -543,6 +543,11 @@ 'virStreamSendAll', # Pure python libvirt-override-virStream.py 'virStreamRecv', # overridden in libvirt-override-virStream.py 'virStreamSend', # overridden in libvirt-override-virStream.py + 'virStreamRecvHole', # overridden in libvirt-override-virStream.py + 'virStreamSendHole', # overridden in libvirt-override-virStream.py + 'virStreamRecvFlags', # overridden in libvirt-override-virStream.py + 'virStreamSparseRecvAll', # overridden in libvirt-override-virStream.py + 'virStreamSparseSendAll', # overridden in libvirt-override-virStream.py 'virConnectUnregisterCloseCallback', # overridden in virConnect.py 'virConnectRegisterCloseCallback', # overridden in virConnect.py diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libvirt-python-3.3.0/libvirt-override-virDomain.py new/libvirt-python-3.4.0/libvirt-override-virDomain.py --- old/libvirt-python-3.3.0/libvirt-override-virDomain.py 2017-04-02 20:58:40.000000000 +0200 +++ new/libvirt-python-3.4.0/libvirt-override-virDomain.py 2017-06-02 09:03:05.000000000 +0200 @@ -63,7 +63,7 @@ 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) + if ret == None: raise libvirtError ('virDomainGetTime() failed', dom=self) return ret def setTime(self, time=None, flags=0): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libvirt-python-3.3.0/libvirt-override-virStream.py new/libvirt-python-3.4.0/libvirt-override-virStream.py --- old/libvirt-python-3.3.0/libvirt-override-virStream.py 2017-04-02 20:58:40.000000000 +0200 +++ new/libvirt-python-3.4.0/libvirt-override-virStream.py 2017-06-02 09:03:05.000000000 +0200 @@ -83,7 +83,7 @@ pass raise e - if got == "": + if not got: break ret = self.send(got) @@ -125,3 +125,145 @@ ret = libvirtmod.virStreamSend(self._o, data) if ret == -1: raise libvirtError ('virStreamSend() failed') return ret + + def recvHole(self, flags = 0): + """This method is used to determine the length in bytes + of the empty space to be created in a stream's target + file when uploading or downloading sparsely populated + files. This is the counterpart to sendHole. + """ + ret = libvirtmod.virStreamRecvHole(self._o, flags) + if ret is None: raise libvirtError ('virStreamRecvHole() failed') + return ret + + def sendHole(self, length, flags = 0): + """Rather than transmitting empty file space, this method + directs the stream target to create length bytes of empty + space. This method would be used when uploading or + downloading sparsely populated files to avoid the + needless copy of empty file space. + """ + ret = libvirtmod.virStreamSendHole(self._o, length, flags) + if ret == -1: raise libvirtError('virStreamSendHole() failed') + return ret + + def recvFlags(self, nbytes, flags = 0): + """Reads a series of bytes from the stream. This method may + block the calling application for an arbitrary amount + of time. This is just like recv except it has flags + argument. + + Errors are not guaranteed to be reported synchronously + with the call, but may instead be delayed until a + subsequent call. + + On success, the received data is returned. On failure, an + exception is raised. If the stream is a NONBLOCK stream and + the request would block, integer -2 is returned. + """ + ret = libvirtmod.virStreamRecvFlags(self._o, nbytes, flags) + if ret is None: raise libvirtError ('virStreamRecvFlags() failed') + return ret + + def sparseRecvAll(self, handler, holeHandler, opaque): + """Receive the entire data stream, sending the data to + the requested data sink handler and calling the skip + holeHandler to generate holes for sparse stream targets. + This is simply a convenient alternative to recvFlags, for + apps that do blocking-I/O and want to preserve sparseness. + + Hypothetical callbacks can look like this: + + def handler(stream, # virStream instance + buf, # string containing received data + opaque): # extra data passed to sparseRecvAll as opaque + fd = opaque + return os.write(fd, buf) + + def holeHandler(stream, # virStream instance + length, # number of bytes to skip + opaque): # extra data passed to sparseRecvAll as opaque + fd = opaque + cur = os.lseek(fd, length, os.SEEK_CUR) + return os.ftruncate(fd, cur) # take this extra step to + # actually allocate the hole + """ + while True: + want = 64 * 1024 + got = self.recvFlags(want, VIR_STREAM_RECV_STOP_AT_HOLE) + if got == -2: + raise libvirtError("cannot use sparseRecvAll with " + "nonblocking stream") + if got == -3: + length = self.recvHole() + if length is None: + self.abort() + raise RuntimeError("recvHole handler failed") + ret = holeHandler(self, length, opaque) + if type(ret) is int and ret < 0: + self.abort() + raise RuntimeError("holeHandler handler returned %d" % ret) + continue + + if len(got) == 0: + break + + ret = handler(self, got, opaque) + if type(ret) is int and ret < 0: + self.abort() + raise RuntimeError("sparseRecvAll handler returned %d" % ret) + + def sparseSendAll(self, handler, holeHandler, skipHandler, opaque): + """Send the entire data stream, reading the data from the + requested data source. This is simply a convenient + alternative to virStreamSend, for apps that do + blocking-I/O and want to preserve sparseness. + + Hypothetical callbacks can look like this: + + def handler(stream, # virStream instance + nbytes, # int amt of data to read + opaque): # extra data passed to sparseSendAll as opaque + fd = opaque + return os.read(fd, nbytes) + + def holeHandler(stream, # virStream instance + opaque): # extra data passed to sparseSendAll as opaque + fd = opaque + cur = os.lseek(fd, 0, os.SEEK_CUR) + # ... find out current section and its boundaries + # and set inData = True/False and sectionLen correspondingly + os.lseek(fd, cur, os.SEEK_SET) + return [inData, sectionLen] + + def skipHandler(stream, # virStream instance + length, # number of bytes to skip + opaque): # extra data passed to sparseSendAll as opaque + fd = opaque + return os.lseek(fd, length, os.SEEK_CUR) + + """ + while True: + [inData, sectionLen] = holeHandler(self, opaque) + if (inData == False and sectionLen > 0): + if (self.sendHole(sectionLen) < 0 or + skipHandler(self, sectionLen, opaque) < 0): + self.abort() + continue + + want = 64 * 1024 + if (want > sectionLen): + want = sectionLen + + got = handler(self, want, opaque) + if type(got) is int and got < 0: + self.abort() + raise RuntimeError("sparseSendAll handler returned %d" % ret) + + if not got: + break + + ret = self.send(got) + if ret == -2: + raise libvirtError("cannot use sparseSendAll with " + "nonblocking stream") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libvirt-python-3.3.0/libvirt-override.c new/libvirt-python-3.4.0/libvirt-override.c --- old/libvirt-python-3.3.0/libvirt-override.c 2017-05-05 21:39:32.000000000 +0200 +++ new/libvirt-python-3.4.0/libvirt-override.c 2017-06-02 09:03:05.000000000 +0200 @@ -9463,6 +9463,103 @@ } #endif /* LIBVIR_CHECK_VERSION(3, 0, 0)*/ + +#if LIBVIR_CHECK_VERSION(3, 4, 0) +static PyObject * +libvirt_virStreamRecvHole(PyObject *self ATTRIBUTE_UNUSED, + PyObject *args) +{ + PyObject *pyobj_stream; + virStreamPtr stream; + long long length = -1; + unsigned int flags; + int ret; + + if (!PyArg_ParseTuple(args, (char *) "OI:virStreamRecvHole", + &pyobj_stream, &flags)) + return NULL; + + stream = PyvirStream_Get(pyobj_stream); + + LIBVIRT_BEGIN_ALLOW_THREADS; + ret = virStreamRecvHole(stream, &length, flags); + LIBVIRT_END_ALLOW_THREADS; + + DEBUG("StreamRecvHole ret=%d length=%lld\n", ret, length); + + if (ret < 0) + return VIR_PY_NONE; + + return libvirt_longlongWrap(length); +} + + +static PyObject * +libvirt_virStreamSendHole(PyObject *self ATTRIBUTE_UNUSED, + PyObject *args) +{ + PyObject *pyobj_stream; + virStreamPtr stream; + long long length; + unsigned int flags; + int ret; + + if (!PyArg_ParseTuple(args, (char *) "OLI:virStreamSendHole", + &pyobj_stream, &length, &flags)) + return NULL; + + stream = PyvirStream_Get(pyobj_stream); + + LIBVIRT_BEGIN_ALLOW_THREADS; + ret = virStreamSendHole(stream, length, flags); + LIBVIRT_END_ALLOW_THREADS; + + DEBUG("StreamSendHole ret=%d\n", ret); + + return libvirt_intWrap(ret); +} + + +static PyObject * +libvirt_virStreamRecvFlags(PyObject *self ATTRIBUTE_UNUSED, + PyObject *args) +{ + PyObject *pyobj_stream; + PyObject *rv; + virStreamPtr stream; + char *buf = NULL; + size_t nbytes; + unsigned int flags; + int ret; + + if (!PyArg_ParseTuple(args, (char *) "OkI:virStreamRecvFlags", + &pyobj_stream, &nbytes, &flags)) + return NULL; + + stream = PyvirStream_Get(pyobj_stream); + + if (VIR_ALLOC_N(buf, nbytes + 1) < 0) + return PyErr_NoMemory(); + + LIBVIRT_BEGIN_ALLOW_THREADS; + ret = virStreamRecvFlags(stream, buf, nbytes, flags); + LIBVIRT_END_ALLOW_THREADS; + + buf[ret > -1 ? ret : 0] = '\0'; + DEBUG("StreamRecvFlags ret=%d strlen=%d\n", ret, (int) strlen(buf)); + + if (ret == -2 || ret == -3) + return libvirt_intWrap(ret); + if (ret < 0) + return VIR_PY_NONE; + rv = libvirt_charPtrSizeWrap((char *) buf, (Py_ssize_t) ret); + VIR_FREE(buf); + return rv; +} + +#endif /* LIBVIR_CHECK_VERSION(3, 4, 0) */ + + /************************************************************************ * * * The registration stuff * @@ -9687,6 +9784,11 @@ {(char *) "virConnectSecretEventRegisterAny", libvirt_virConnectSecretEventRegisterAny, METH_VARARGS, NULL}, {(char *) "virConnectSecretEventDeregisterAny", libvirt_virConnectSecretEventDeregisterAny, METH_VARARGS, NULL}, #endif /* LIBVIR_CHECK_VERSION(3, 0, 0) */ +#if LIBVIR_CHECK_VERSION(3, 4, 0) + {(char *) "virStreamRecvHole", libvirt_virStreamRecvHole, METH_VARARGS, NULL}, + {(char *) "virStreamSendHole", libvirt_virStreamSendHole, METH_VARARGS, NULL}, + {(char *) "virStreamRecvFlags", libvirt_virStreamRecvFlags, METH_VARARGS, NULL}, +#endif /* LIBVIR_CHECK_VERSION(3, 4, 0) */ {NULL, NULL, 0, NULL} }; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libvirt-python-3.3.0/libvirt-python.spec new/libvirt-python-3.4.0/libvirt-python.spec --- old/libvirt-python-3.3.0/libvirt-python.spec 2017-05-05 21:48:17.000000000 +0200 +++ new/libvirt-python-3.4.0/libvirt-python.spec 2017-06-02 09:04:20.000000000 +0200 @@ -6,7 +6,7 @@ Summary: The libvirt virtualization API python2 binding Name: libvirt-python -Version: 3.3.0 +Version: 3.4.0 Release: 1%{?dist}%{?extra_release} Source0: http://libvirt.org/sources/python/%{name}-%{version}.tar.gz Url: http://libvirt.org @@ -65,7 +65,6 @@ %if %{with_python3} %{__python3} setup.py install --skip-build --root=%{buildroot} %endif -rm -f %{buildroot}%{_libdir}/python*/site-packages/*egg-info %check %{__python} setup.py test @@ -80,6 +79,7 @@ %{_libdir}/python2*/site-packages/libvirt_qemu.py* %{_libdir}/python2*/site-packages/libvirt_lxc.py* %{_libdir}/python2*/site-packages/libvirtmod* +%{_libdir}/python2*/site-packages/*egg-info %if %{with_python3} %files -n libvirt-python3 @@ -94,6 +94,7 @@ %{_libdir}/python3*/site-packages/__pycache__/libvirt_lxc.cpython-*.py* %{_libdir}/python3*/site-packages/__pycache__/libvirtaio.cpython-*.py* %{_libdir}/python3*/site-packages/libvirtmod* +%{_libdir}/python3*/site-packages/*egg-info %endif %changelog diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libvirt-python-3.3.0/sanitytest.py new/libvirt-python-3.4.0/sanitytest.py --- old/libvirt-python-3.3.0/sanitytest.py 2017-05-05 21:39:32.000000000 +0200 +++ new/libvirt-python-3.4.0/sanitytest.py 2017-06-02 09:03:05.000000000 +0200 @@ -167,7 +167,8 @@ # These aren't functions, they're callback signatures if name in ["virConnectAuthCallbackPtr", "virConnectCloseFunc", "virStreamSinkFunc", "virStreamSourceFunc", "virStreamEventCallback", - "virEventHandleCallback", "virEventTimeoutCallback", "virFreeCallback"]: + "virEventHandleCallback", "virEventTimeoutCallback", "virFreeCallback", + "virStreamSinkHoleFunc", "virStreamSourceHoleFunc", "virStreamSourceSkipFunc"]: continue if name[0:21] == "virConnectDomainEvent" and name[-8:] == "Callback": continue @@ -373,7 +374,8 @@ # These exist in C and exist in python, but we've got # a pure-python impl so don't check them - if name in ["virStreamRecvAll", "virStreamSendAll"]: + if name in ["virStreamRecvAll", "virStreamSendAll", + "virStreamSparseRecvAll", "virStreamSparseSendAll"]: continue try: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libvirt-python-3.3.0/setup.py new/libvirt-python-3.4.0/setup.py --- old/libvirt-python-3.3.0/setup.py 2017-05-05 21:40:51.000000000 +0200 +++ new/libvirt-python-3.4.0/setup.py 2017-06-02 09:04:16.000000000 +0200 @@ -334,7 +334,7 @@ _c_modules, _py_modules = get_module_lists() setup(name = 'libvirt-python', - version = '3.3.0', + version = '3.4.0', url = 'http://www.libvirt.org', maintainer = 'Libvirt Maintainers', maintainer_email = '[email protected]',
