qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 02/10] qga: implement guest-pipe-open command


From: Denis V. Lunev
Subject: Re: [Qemu-devel] [PATCH 02/10] qga: implement guest-pipe-open command
Date: Fri, 19 Jun 2015 20:59:38 +0300
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:31.0) Gecko/20100101 Thunderbird/31.7.0

On 19/06/15 20:34, Eric Blake wrote:
On 06/19/2015 10:57 AM, Denis V. Lunev wrote:
From: Olga Krishtal <address@hidden>

The command creates FIFO pair that can be used with existing file
read/write interfaces to communicate with processes spawned via the
forthcoming guest-file-exec interface.

Signed-off-by: Olga Krishtal <address@hidden>
Signed-off-by: Denis V. Lunev <address@hidden>
Acked-by: Roman Kagan <address@hidden>
CC: Eric Blake <address@hidden>
CC: Michael Roth <address@hidden>
---
  qga/commands-posix.c | 96 +++++++++++++++++++++++++++++++++++++++++++++++++---
  qga/commands-win32.c |  8 ++++-
  qga/qapi-schema.json | 44 ++++++++++++++++++++++++
  3 files changed, 143 insertions(+), 5 deletions(-)

+
+    if (pipe(fd) != 0) {
+        error_set_errno(errp, errno, QERR_QGA_COMMAND_FAILED, "pipe() failed");
+        return NULL;
+    }
+
+    this_end = (mode == GUEST_PIPE_MODE_WRITE);
+    other_end = !this_end;
+
+    qemu_set_nonblock(fd[this_end]);
+
+    qemu_set_cloexec(fd[this_end]);
+    qemu_set_cloexec(fd[other_end]);
Would it be better to create a named FIFO somewhere in the file system,
so that you can reopen the connection even if the qga daemon is
restarted?  By using just pipe(), your fds are rather ephemeral, but if
I understand correctly, the rest of the guest-file API tries to persist
across qga restart.

this will not help IMHO

Let us assume that we have a FIFO on a filesystem
and we have a process which uses this FIFO as
stdout. If QGA will exit that process will blown up with
SIGPIPE on any write attempt.

Den



reply via email to

[Prev in Thread] Current Thread [Next in Thread]