[libvirt] [PATCH v2 31/32] fdstream: Suppress use of IO helper for sparse streams

Michal Privoznik mprivozn at redhat.com
Mon May 23 15:58:23 UTC 2016


This is just a hack so that reviewers can try sparse streams out.
Problem is, if nonblocking streams are requested (which is case
of every single stream in the daemon), we spawn IO helper and
create a pipe to read data from it. But that means fd that
virFDStreamInData() sees is to our end of pipe, not the actual
file. Therefore any lseek() fails (one simply doesn't seek over a
pipe). Solution would be to bring some protocol to our
communication with the IO helper. But that's going to be yet
another N patches and this patch set is long enough as is. So
just for the sake of review, do this hack for now.

Signed-off-by: Michal Privoznik <mprivozn at redhat.com>
 src/fdstream.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/fdstream.c b/src/fdstream.c
index 18a2bc0..cf0c325 100644
--- a/src/fdstream.c
+++ b/src/fdstream.c
@@ -761,9 +761,9 @@ virFDStreamOpenFileInternal(virStreamPtr st,
      * support those we need to fork a helper process to do
      * the I/O so we just have a fifo. Or use AIO :-(
-    if ((st->flags & VIR_STREAM_NONBLOCK) &&
-        ((!S_ISCHR(sb.st_mode) &&
-          !S_ISFIFO(sb.st_mode)) || forceIOHelper)) {
+    if (0 && ((st->flags & VIR_STREAM_NONBLOCK) &&
+              ((!S_ISCHR(sb.st_mode) &&
+                !S_ISFIFO(sb.st_mode)) || forceIOHelper))) {
         int fds[2] = { -1, -1 };
         if ((oflags & O_ACCMODE) == O_RDWR) {

More information about the libvir-list mailing list