[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
signature.asc
Description: OpenPGP digital signature
- [Qemu-devel] [PATCH v5 0/10] QGA: disk and volume info for Windows & guest exec, Denis V. Lunev, 2015/06/19
- [Qemu-devel] [PATCH 01/10] util, qga: drop guest_file_toggle_flags, Denis V. Lunev, 2015/06/19
- [Qemu-devel] [PATCH 02/10] qga: implement guest-pipe-open command, Denis V. Lunev, 2015/06/19
- [Qemu-devel] [PATCH 04/10] qga: handle possible SIGPIPE in guest-file-write, Denis V. Lunev, 2015/06/19
- [Qemu-devel] [PATCH 05/10] qga: guest-pipe-open for Windows guest, Denis V. Lunev, 2015/06/19
- [Qemu-devel] [PATCH 06/10] qga: guest exec functionality for Windows guests, Denis V. Lunev, 2015/06/19
- [Qemu-devel] [PATCH 03/10] qga: guest exec functionality for Unix guests, Denis V. Lunev, 2015/06/19
- [Qemu-devel] [PATCH 07/10] qga: added empty qmp_quest_get_fsinfo functionality., Denis V. Lunev, 2015/06/19
- [Qemu-devel] [PATCH 08/10] qga: added mountpoint and filesystem type for single volume, Denis V. Lunev, 2015/06/19
- [Qemu-devel] [PATCH 09/10] qga: added bus type and disk location path, Denis V. Lunev, 2015/06/19