[PATCH 0/2] fdstream: attempt to fix EOF handling (again)

Daniel P. Berrangé via Devel posted 2 patches 6 days, 6 hours ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/20260224182604.309069-1-berrange@redhat.com
src/util/virfdstream.c | 20 +++++++++++++++++---
1 file changed, 17 insertions(+), 3 deletions(-)
[PATCH 0/2] fdstream: attempt to fix EOF handling (again)
Posted by Daniel P. Berrangé via Devel 6 days, 6 hours ago

Daniel P. Berrangé (2):
  fdstream: don't set return value if looping to read more data
  fdstream: fix EOF handling when reading data

 src/util/virfdstream.c | 20 +++++++++++++++++---
 1 file changed, 17 insertions(+), 3 deletions(-)

-- 
2.53.0

Re: [PATCH 0/2] fdstream: attempt to fix EOF handling (again)
Posted by Pavel Hrdina via Devel 3 days, 14 hours ago
On Tue, Feb 24, 2026 at 06:26:02PM +0000, Daniel P. Berrangé via Devel wrote:
> 
> 
> Daniel P. Berrangé (2):
>   fdstream: don't set return value if looping to read more data
>   fdstream: fix EOF handling when reading data

Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Re: [PATCH 0/2] fdstream: attempt to fix EOF handling (again)
Posted by Ján Tomko via Devel 3 days, 14 hours ago
On a Tuesday in 2026, Daniel P. Berrangé via Devel wrote:
>
>
>Daniel P. Berrangé (2):
>  fdstream: don't set return value if looping to read more data
>  fdstream: fix EOF handling when reading data
>
> src/util/virfdstream.c | 20 +++++++++++++++++---
> 1 file changed, 17 insertions(+), 3 deletions(-)
>

Reviewed-by: Ján Tomko <jtomko@redhat.com>

Jano
Re: [PATCH 0/2] fdstream: attempt to fix EOF handling (again)
Posted by Roman Bogorodskiy 6 days, 6 hours ago
  Daniel P. Berrangé wrote:

> 
> 
> Daniel P. Berrangé (2):
>   fdstream: don't set return value if looping to read more data
>   fdstream: fix EOF handling when reading data
> 
>  src/util/virfdstream.c | 20 +++++++++++++++++---
>  1 file changed, 17 insertions(+), 3 deletions(-)

Yay, this one works!

Tested-by: Roman Bogorodskiy <bogorodskiy@gmail.com>
Re: [PATCH 0/2] fdstream: attempt to fix EOF handling (again)
Posted by Daniel P. Berrangé via Devel 6 days, 6 hours ago
In debugging this issue, I also came to the conclusion that the
VIR_STREAM_NONBLOCK handling is completely broken when the
background thread is in use.

It was always partially broken even when we used a pipe between
the foreground and backgroud threads, likely leading to busy
looping AFAICT.

With the switch to virFDSteamMsg queues, it looks like we hard
block on reads and have unlimited memory usage on writes.

I filed:

  https://gitlab.com/libvirt/libvirt/-/issues/855

since I can't see an immediate easy fix for this :-(

On Tue, Feb 24, 2026 at 06:26:02PM +0000, Daniel P. Berrangé wrote:
> 
> 
> Daniel P. Berrangé (2):
>   fdstream: don't set return value if looping to read more data
>   fdstream: fix EOF handling when reading data
> 
>  src/util/virfdstream.c | 20 +++++++++++++++++---
>  1 file changed, 17 insertions(+), 3 deletions(-)
> 
> -- 
> 2.53.0
> 

With regards,
Daniel
-- 
|: https://berrange.com       ~~        https://hachyderm.io/@berrange :|
|: https://libvirt.org          ~~          https://entangle-photo.org :|
|: https://pixelfed.art/berrange   ~~    https://fstop138.berrange.com :|