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: Eric Blake
Subject: Re: [Qemu-devel] [PATCH 02/10] qga: implement guest-pipe-open command
Date: Fri, 19 Jun 2015 11:34:15 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0

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.

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

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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