From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:39430) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TjUxC-0002zB-MK for qemu-devel@nongnu.org; Fri, 14 Dec 2012 08:05:28 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TjUxB-00062a-Cu for qemu-devel@nongnu.org; Fri, 14 Dec 2012 08:05:26 -0500 Received: from mx1.redhat.com ([209.132.183.28]:2689) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TjUxB-00062W-5M for qemu-devel@nongnu.org; Fri, 14 Dec 2012 08:05:25 -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 qBED5Odq016333 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 14 Dec 2012 08:05:24 -0500 Message-ID: <50CB2413.2090508@redhat.com> Date: Fri, 14 Dec 2012 06:05:23 -0700 From: Eric Blake MIME-Version: 1.0 References: <1355477883-15728-1-git-send-email-kraxel@redhat.com> <1355477883-15728-4-git-send-email-kraxel@redhat.com> <50CB18E1.90706@redhat.com> In-Reply-To: <50CB18E1.90706@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------enig8CD4D3B054EC982C09985BA7" Subject: Re: [Qemu-devel] [PATCH 3/3] chardev: add hotplug support. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: Gerd Hoffmann , qemu-devel@nongnu.org This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig8CD4D3B054EC982C09985BA7 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 12/14/2012 05:17 AM, Paolo Bonzini wrote: > Il 14/12/2012 10:38, Gerd Hoffmann ha scritto: >> This patch adds chardev_add_file, chardev_add_tty and chardev_remove >> monitor commands. >> >> chardev_add_file and chardev_add_tty expect an id and a path, they >> create a file/tty chardev. >=20 > I'd rather avoid introducing this interface. Using multiple commands i= s > different from all previous examples, both HMP and QMP (including recen= t > ones such as the NBD server). It is also hard to extend, for example > file descriptor passing is hard to retrofit. File descriptor passing via magic /dev/fdset/nnn should probably already work. That said, a single command that uses a QAPI union, rather than one command per source type, would be nicer from the UI perspective, and it is the QMP UI perspective that libvirt is concerned about. >=20 > Perhaps you can define a QAPI union and slowly build it up? Something > that ultimately can become this: >=20 > { 'enum': 'ChardevFileMode', 'data': > # pty =3D console under Windows > # serial =3D tty under POSIX > [ 'file', 'pipe', 'parport', 'pty', 'serial' ] } >=20 > { 'enum: 'ChardevFileSource', 'data': > [ 'path', 'fd' ] } >=20 > { 'type': 'ChardevFile', > 'data': {'source': 'string', 'source-type': 'ChardevFileSource', > 'mode': 'ChardevFileMode'}} >=20 > { 'type': 'ChardevVC', > 'data': {'width': 'int', 'height': 'int', '*characters': 'bool'}} >=20 > { 'type': 'ChardevSocket', > 'data': {'addr': 'SocketAddress', '*server': 'bool', > '*wait': 'bool', '*nodelay': 'bool', '*telnet': 'bool'} } >=20 > # For future extensibility... > { 'ChardevDummy', 'data': {} } >=20 > { 'union': 'ChardevBackend', 'data': { > 'socket': 'ChardevSocket', > 'udp': 'UDPSocketAddress', > 'file': 'ChardevFile', > 'null': 'ChardevDummy', > 'msmouse': 'ChardevDummy', > 'braille': 'ChardevDummy', > 'stdio': 'ChardevDummy', > 'vc': 'ChardevVC', >=20 > # Solely for HMP usage. > 'legacy': 'str' > } >=20 > { 'command': 'chardev-add', 'data': { > 'backend': 'ChardevBackend', 'id': 'str', '*mux': 'bool' } } Yes, this looks nicer. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --------------enig8CD4D3B054EC982C09985BA7 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/ iQEcBAEBCAAGBQJQyyQTAAoJEKeha0olJ0NquZgH/11Gn+sXoI5q1Vmf1WZQPLC8 dRrSOw/BJDfyzXdCJtduaoDiqr50nmJe7By7mbv/g6J1ACdLCMXjmU/bK5uqr3oX dD/dXVZgjj9vsd7T/l+w0vfGwNvMiK7VF1yq8ySN6tUjQIUM1Yi2plsFb82TlxM9 74X9GWJkg/uDLfd7tQWVnIBrP6L4RphTNRtMv9fhaTV77qIcw1agvXHWwQmuuQ7P SZA62KFB9YPZ3eIimy0lnRL+KfMmF89CUQfZooDkxCOYD3VJV7cwYHewPs5OW0Gw nrPgBZvwex8GsW+yMlw5cktrF4oeQM4lkiAGjOVG3uSXt+HNHZnpjlfWG/96EcI= =+xmG -----END PGP SIGNATURE----- --------------enig8CD4D3B054EC982C09985BA7--