From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:42087) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tt08R-0003h0-C5 for qemu-devel@nongnu.org; Wed, 09 Jan 2013 13:12:21 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Tt08P-0003He-Nv for qemu-devel@nongnu.org; Wed, 09 Jan 2013 13:12:19 -0500 Received: from mx1.redhat.com ([209.132.183.28]:44942) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tt08P-0003HR-Ge for qemu-devel@nongnu.org; Wed, 09 Jan 2013 13:12:17 -0500 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r09ICGTS021408 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 9 Jan 2013 13:12:17 -0500 Message-ID: <50EDB300.1030601@redhat.com> Date: Wed, 09 Jan 2013 11:12:16 -0700 From: Eric Blake MIME-Version: 1.0 References: <1357566928-25361-1-git-send-email-kraxel@redhat.com> <1357566928-25361-7-git-send-email-kraxel@redhat.com> In-Reply-To: <1357566928-25361-7-git-send-email-kraxel@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------enig7F7AF241A2E260FDFF22B41C" Subject: Re: [Qemu-devel] [PATCH 06/11] chardev: add file chardev support to chardev-add (qmp) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gerd Hoffmann Cc: qemu-devel@nongnu.org This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig7F7AF241A2E260FDFF22B41C Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 01/07/2013 06:55 AM, Gerd Hoffmann wrote: > Add support for file chardevs. Output file is mandatory, > input file is optional. Both file names and file descriptor > passing is supported. >=20 > Signed-off-by: Gerd Hoffmann > --- > qapi-schema.json | 9 +++++- > qemu-char.c | 77 ++++++++++++++++++++++++++++++++++++++++++++++= +++++++- > 2 files changed, 84 insertions(+), 2 deletions(-) >=20 > diff --git a/qapi-schema.json b/qapi-schema.json > index e3f0d44..8904d36 100644 > --- a/qapi-schema.json > +++ b/qapi-schema.json > @@ -3030,9 +3030,16 @@ > # > # Since: 1.4 > ## > +{ 'union': 'ChardevFileSource', 'data': { 'path' : 'str', > + 'fd' : 'str' } } > + > +{ 'type': 'ChardevFile', 'data': { '*in' : 'ChardevFileSource', > + 'out' : 'ChardevFileSource' } } > + > { 'type': 'ChardevDummy', 'data': { } } > =20 > -{ 'union': 'ChardevBackend', 'data': { 'null' : 'ChardevDummy' } } > +{ 'union': 'ChardevBackend', 'data': { 'file' : 'ChardevFile', > + 'null' : 'ChardevDummy' } } > =20 > { 'command': 'chardev-add', 'data': {'id' : 'str', > 'backend' : 'ChardevBackend' } } An example in qmp-commands.hx would be helpful; am I correct that an example would be: -> { "execute" : "chardev-add", "arguments" : { "id" : "foo", "backend" : { "type" : "file", "data" : { "in" : { "type" : "fd", "data" : "namedfd" }, "out" : { "type" : "path", "data" : "/path/to/file" } } } } } <- { "return": {} } where namedfd was previously given via 'getfd'? Do we need the complexity of supporting fd passing explicitly? 'getfd' is less than ideal compared to 'add-fd', and for 'add-fd', we would pass via "path":"/dev/fdset/nnn". That is, why do we need to bend over backwards to support an alternate syntax for fd passing in a new command, when we can already use existing commands to get fd passing for free? --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --------------enig7F7AF241A2E260FDFF22B41C Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with undefined - http://www.enigmail.net/ iQEcBAEBCAAGBQJQ7bMAAAoJEKeha0olJ0NqPwYIAITxnMm23NmibIVpXLxn22mk 87Os1TtGXBd/0adltugIdAyJHBWBHXGSAPlDMZLV4GqLXEyECo8JjZxuX+ReNW6X IXu02ujpjObfCHvq0OHOmhUMIqrC8n/XU1pZ51WZBoJXo94z3QOKTRjbUCs/wCZC cgH3jlu3Oo94sIeDom28Dt0nFpLsJ04J78iSr1LPoISbXsK33D9bHOqQMgxfSGn9 p7WsXWplcjKvihWWE0nrzrXfyVH2pNhqs5AwVq2g6tPQfhEURGDaK8tkGIpoqEI5 W2mMXDL3f3iYK3iqaszrHUzcL2BWoQCjF6ke2V2/vS4VPPvKstYvj7USM48vtEU= =WzHm -----END PGP SIGNATURE----- --------------enig7F7AF241A2E260FDFF22B41C--