Erik Huelsmann wrote:

> Hi Roman,
> 
> On Mon, Feb 16, 2026, 19:32 Roman Bogorodskiy <[email protected]> wrote:
> 
> >   Erik Huelsmann wrote:
> >
> > > Before this change, buffers returned from virFDStreamRead() would
> > > alternate in size (262120 and 24), because it only consumed the
> > > bytes remaining from the current background thread message.
> > >
> > > As the background thread reads 262144 bytes (256kB) of data in
> > > each chunk, where the maximum size returned from virFDStreamRead()
> > > to be transferred over the remote protocol is only 262120, 24 bytes
> > > would be left in the buffer on each iteration. The next iteration
> > > leaves 24 bytes, which used to be returned without considering
> > > messages waiting in the queue.
> > >
> > > Signed-off-by: Erik Huelsmann <[email protected]>
> > > ---
> > >  src/util/virfdstream.c | 26 +++++++++++++++++---------
> > >  1 file changed, 17 insertions(+), 9 deletions(-)
> >
> > Hi,
> >
> > I noticed that with this change libvirt-tck tests started failing for
> > me on FreeBSD:
> >
> >     ../scripts/storage/400-vol-download.t
> >     ../scripts/storage/405-vol-download-all.t
> >     ../scripts/storage/410-vol-download-nonblock.t
> >
> > Things get back to normal when I revert this commit.
> >
> > The only thing I see in the log is:
> >
> > 2026-02-16 18:04:27.505+0000: 75802027180048: error : virFDStreamRead:921
> > : stream is not open: Bad file descriptor
> >
> 
> I see these are Perl scripts. Can you run the tests in verboden mode?
> ("prove --verbose") That should provide an indication of the point in the
> test where the error occurs

root@testrunner:~/libvirt-tck # PERL5LIB=./lib 
LIBVIRT_TCK_CONFIG=/etc/libvirt-tck/default.yml prove --verbose  
./scripts/storage/400-vol-download.t
./scripts/storage/400-vol-download.t .. 
1..16
# Defining transient storage pool
ok 1 - define transient storage pool
ok 2 - built storage pool
ok 3 - started storage pool
ok 4 - create raw volume
ok 5 - started download
libvirt error code: 38, message: stream is not open: Bad file descriptor
# Looks like your test exited with 255 just after 5.

By running it with '-d:Trace` it looks like it's failing on this
specific line:

https://gitlab.com/libvirt/libvirt-tck/-/blob/master/scripts/storage/400-vol-download.t?ref_type=heads#L108

>> ./scripts/storage/400-vol-download.t:108:    my $rv = $st->recv($data, 
>> $nbytes);
>> /usr/local/lib/perl5/site_perl/mach/5.42/Sys/Virt/Error.pm:52:     my $self 
>> = shift;
>> /usr/local/lib/perl5/site_perl/mach/5.42/Sys/Virt/Error.pm:54:     return 
>> "libvirt error code: " . $self->{code} . ", message: " . $self->{message} . 
>> ($self->{message} =~ /\n$/ ? "" : "\n");
libvirt error code: 38, message: stream is not open: Bad file descriptor

Also, looking at the trace, it's not the first iteration of the
`while (1) {` loop.

Reply via email to