]> git.ipfire.org Git - thirdparty/libvirt.git/commit
virStreamInData: Allow callback to not rewind the stream
authorMichal Privoznik <mprivozn@redhat.com>
Tue, 7 Dec 2021 13:43:33 +0000 (14:43 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Mon, 13 Dec 2021 13:49:02 +0000 (14:49 +0100)
commitdd75e2e4645137c8ede69ddc14ce528e696d4246
treee5c0cf9baf1e4483e16a6cc46bd2df9299da94d5
parentd47a4bfa7b602cbb764076a685cebb920d00555a
virStreamInData: Allow callback to not rewind the stream

So far, virStreamInData() is effectively a wrapper over
virFDStreamInData() which means it deals with files which can be
rewound (lseek()-ed) to whatever position we need. And in fact,
that's what virFDStreamInData() does - it makes sure that the FD
is left unchanged in terms of position in the file.  Skipping the
hole happens soon after - in daemonStreamHandleRead() when
virStreamSendHole() is called.

But this is about to change. Soon we will have another implementation
where we won't be dealing with FDs but virNetMessage queue and it will
be handy to pop message at the beginning of the queue. Implement and
document this new behavior.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
src/libvirt-stream.c
src/remote/remote_daemon_stream.c