]> git.ipfire.org Git - thirdparty/libvirt.git/commit
tests: don't mix FILE* and UNIX FD I/O on same stream
authorDaniel P. Berrangé <berrange@redhat.com>
Mon, 21 Sep 2020 17:32:29 +0000 (18:32 +0100)
committerDaniel P. Berrangé <berrange@redhat.com>
Tue, 22 Sep 2020 09:45:33 +0000 (10:45 +0100)
commit946c815024203bf790e401b516a584f18ca2d1a9
treef865763d1650471f1dbd792cfb6ad53df1b716c3
parentcb09344a2cccc0cc9bcefa3cb53d7af45ba92631
tests: don't mix FILE* and UNIX FD I/O on same stream

There is currently a hang in test27 that exhibits itself on FreeBSD 11.4
only. The behaviour is that virCommandProcessIO gets POLLIN on the
FD for stdout, but read() blocks. Meanwhile commandtest also blocks
in write for stderr because the pipe buffers are full.

This fix in commandhelper likely does not really address the root cause
just hides it due to the buffering done by FILE *. Mixing UNIX FD I/O
and FILE * I/O is bad practice regardless.

Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
tests/commandhelper.c