From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59561) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z60BJ-0003Yb-Fm for qemu-devel@nongnu.org; Fri, 19 Jun 2015 13:34:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z60BF-0008Rd-Ff for qemu-devel@nongnu.org; Fri, 19 Jun 2015 13:34:21 -0400 Received: from mx1.redhat.com ([209.132.183.28]:39209) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z60BF-0008RP-B9 for qemu-devel@nongnu.org; Fri, 19 Jun 2015 13:34:17 -0400 Message-ID: <55845297.4020605@redhat.com> Date: Fri, 19 Jun 2015 11:34:15 -0600 From: Eric Blake MIME-Version: 1.0 References: <1434733075-24240-1-git-send-email-den@openvz.org> <1434733075-24240-3-git-send-email-den@openvz.org> In-Reply-To: <1434733075-24240-3-git-send-email-den@openvz.org> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="3fx3u2mQFIRqvf8XdjPkPSjVCv4H0GA2l" Subject: Re: [Qemu-devel] [PATCH 02/10] qga: implement guest-pipe-open command List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Denis V. Lunev" Cc: Olga Krishtal , qemu-devel@nongnu.org, Michael Roth This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --3fx3u2mQFIRqvf8XdjPkPSjVCv4H0GA2l Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 06/19/2015 10:57 AM, Denis V. Lunev wrote: > From: Olga Krishtal >=20 > 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. >=20 > Signed-off-by: Olga Krishtal > Signed-off-by: Denis V. Lunev > Acked-by: Roman Kagan > CC: Eric Blake > CC: Michael Roth > --- > qga/commands-posix.c | 96 ++++++++++++++++++++++++++++++++++++++++++++= +++++--- > qga/commands-win32.c | 8 ++++- > qga/qapi-schema.json | 44 ++++++++++++++++++++++++ > 3 files changed, 143 insertions(+), 5 deletions(-) >=20 > + > + if (pipe(fd) !=3D 0) { > + error_set_errno(errp, errno, QERR_QGA_COMMAND_FAILED, "pipe() = failed"); > + return NULL; > + } > + > + this_end =3D (mode =3D=3D GUEST_PIPE_MODE_WRITE); > + other_end =3D !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. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --3fx3u2mQFIRqvf8XdjPkPSjVCv4H0GA2l Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJVhFKXAAoJEKeha0olJ0NqHjsH/RHDJoaeejqrhiSWBPzqdzsF LHkxiokvGWAhTT+q2hY41uL7rFLuY1sm7upsfM5KnEiIffGxAhQREOcNk1fuGKs6 CBUsAXB/r++f23mZKE8QTVzgR8lpnUcF6eqTppPgfgTFXgQ7GgmRYtnLXOrwbwia tO5YKycB/fNqbssLxFTU71Ff8Zfk4HvyeJ+BiUzZdRNtOUmBNZRvYNRb8+u+Xmqg IK5DyrCz71grqs8w9FgWjecoItK6LnqTvBUYziGHDIY8U/AHBvpoFeB45oXPiDz7 iXXH9XvbRY/K/Gbgkm0wN0Y/i70fOPcBDMtscD1yt4wrXb5/RnGI4SKTmeAyO3w= =MIpi -----END PGP SIGNATURE----- --3fx3u2mQFIRqvf8XdjPkPSjVCv4H0GA2l--