[libvirt] [PATCH] iohelper: Don't try to fdatasync(stdout)

Eric Blake eblake at redhat.com
Mon Nov 5 13:45:37 UTC 2012


On 11/05/2012 06:21 AM, Christophe Fergeau wrote:
> After upgrading to libvirt 1.0.0, I've started getting warnings
> from libvirt:
> (gnome-boxes:5965): Libvirt.GObject-CRITICAL **: cannot finish stream:
> internal error libvirt_iohelper: unable to fsync stdout: Invalid argument
> 
> On further investigation, in iohelper.c:runIO(), fdatasync can get called
> on STDOUT_FILENO, which indeed returns EINVAL when this happens. After
> making sure that fdout is not STDOUT_FILENO, this warning goes away.
> ---
>  src/util/iohelper.c | 8 +++++---
>  1 file changed, 5 insertions(+), 3 deletions(-)

NACK.  It is not because we are calling fdatasync(1), but because fd 1
happens to be something that is not syncable (perhaps a pipe).  We need
to figure out the real condition on when fd 1 is syncable, and skip the
error in the case where it is a pipe or some other non-syncable fd, and
not based on some magic exemption of just fd 1 without even knowing why
we are failing.

-- 
Eric Blake   eblake at redhat.com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 617 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20121105/45638370/attachment-0001.sig>


More information about the libvir-list mailing list