From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58242) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z6083-0004rF-N6 for qemu-devel@nongnu.org; Fri, 19 Jun 2015 13:31:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z607w-0005Al-QU for qemu-devel@nongnu.org; Fri, 19 Jun 2015 13:30:59 -0400 Received: from mx1.redhat.com ([209.132.183.28]:38345) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z607w-0005A1-Ho for qemu-devel@nongnu.org; Fri, 19 Jun 2015 13:30:52 -0400 Message-ID: <558451C6.3070603@redhat.com> Date: Fri, 19 Jun 2015 11:30:46 -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="Uk4jNECWDWnpq5nC2mHLbhuadIh0kvPPU" 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) --Uk4jNECWDWnpq5nC2mHLbhuadIh0kvPPU 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(-) Just an interface review at this point: > +++ b/qga/qapi-schema.json > @@ -215,12 +215,56 @@ > 'returns': 'int' } > =20 > ## > +# @GuestPipeMode > +# > +# An enumeration of pipe modes > +# read: pipe is opened for writing data > +# write: pipe is opened for reading data > +# > +# Since: 2.4 > +## > +{ 'enum': 'GuestPipeMode', > + 'data': [ 'read', 'write' ] } > + > +## > +# @GuestPipeInfo > +# > +# Information about pipe. > +# > +# Since: 2.4 > +## > +{ 'struct': 'GuestPipeInfo', > + 'data': {'fd': 'int'} } Missing a field of type GuestPipeMode? > + > +## > +# @guest-pipe-open > +# > +# Open a pipe to in the guest to associated with a qga-spawned process= es > +# for communication. Reads poorly. Maybe: Open a pipe in the guest for association with later qga-spawned processes= =2E > +# > +# Returns: Guest file handle on success, as per guest-file-open. This > +# handle is usable with the same interfaces as a handle returned by > +# guest-file-open. > +# > +# Since: 2.4 > +## > +{ 'command': 'guest-pipe-open', > + 'data': { 'mode': 'GuestPipeMode' }, > + 'returns': ['GuestPipeInfo'] } I'm assuming the array will always contain two elements? Would it be any simpler to return a single dictionary of { 'read': 'int', 'write': 'int' } for naming the two fds directly, instead of having to parse through [ { 'fd': 1 }, { 'fd': 2 } ] ? > + > +## > +## > # @guest-file-close: > # > # Close an open file in the guest > # > # @handle: filehandle returned by guest-file-open > # > +# Please note that closing the write side of a pipe will block until t= he read > +# side is closed. If you passed the read-side of the pipe to a qga-sp= awned > +# process, make sure the process has exited before attempting to close= the > +# write side. > +# > # Returns: Nothing on success. > # > # Since: 0.15.0 >=20 --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --Uk4jNECWDWnpq5nC2mHLbhuadIh0kvPPU 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/ iQEcBAEBCAAGBQJVhFHGAAoJEKeha0olJ0NqT5IIAJKImRCe7d5LebFS1FBaD5ZA IOJiN6LbnH3qauUbxRhvuq63DUomxLPmknG8doTVQwBb7I9vFh3K2oS2wyF1t7p2 /xxFAJ1Y0GzSZco15rzmA4G3KEItf+wZxneK838p6evGZFr/fGIO++xlrRekxR+Y yywyW5/txkLFMC0u1kuwl0mGW3Qck0SIN8sw98P/jT+JZMHeii+OcYGdBiwUmk6f 142fXa65cOz4nVt3QaGjVZAR6eoM0QBYP5BrTjtzRJU5yVWpp6kTYcGkubaWfWl/ yjH/gt7PQAzUG6SSCijyOqw/XBVgT4J3RAyJ4zPrQ+qW2F7qZJ0FDRnNguuSOlo= =YW6F -----END PGP SIGNATURE----- --Uk4jNECWDWnpq5nC2mHLbhuadIh0kvPPU--