diff options
author | Michal Privoznik <mprivozn@redhat.com> | 2017-05-22 08:25:23 +0200 |
---|---|---|
committer | Michal Privoznik <mprivozn@redhat.com> | 2017-05-23 13:43:15 +0200 |
commit | 2e4cb221228e4927aa4eca90be87708921c85f11 (patch) | |
tree | b315c793137a9af1dfd06969579b41375804cf41 /libvirt-override-virStream.py | |
parent | 1f42d8629f7fa516ebe8e02b74cbeba1e46aab4e (diff) | |
download | libvirt-python-2e4cb221228e4927aa4eca90be87708921c85f11.tar.gz |
virStream: Introduce virStreamRecvFlags
Yet again, we need a custom wrapper over virStreamRecvFlags
because our generator is not capable of generating it.
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Diffstat (limited to 'libvirt-override-virStream.py')
-rw-r--r-- | libvirt-override-virStream.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/libvirt-override-virStream.py b/libvirt-override-virStream.py index 62c1328..66d2bf6 100644 --- a/libvirt-override-virStream.py +++ b/libvirt-override-virStream.py @@ -146,3 +146,21 @@ 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 |