diff --git a/src/util/iohelper.c b/src/util/iohelper.c index 860e14a98f..a9c8b4cefa 100644 --- a/src/util/iohelper.c +++ b/src/util/iohelper.c @@ -181,8 +181,11 @@ runIO(const char *path, int fd, int oflags, unsigned long long length) /* Ensure all data is written */ if (fdatasync(fdout) < 0) { - virReportSystemError(errno, _("unable to fsync %s"), fdoutname); - goto cleanup; + if (errno != EINVAL && errno != EROFS) { + /* fdatasync() may fail on some special FDs, e.g. pipes */ + virReportSystemError(errno, _("unable to fsync %s"), fdoutname); + goto cleanup; + } } ret = 0;