From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:41880) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TjWrW-00058Z-Kb for qemu-devel@nongnu.org; Fri, 14 Dec 2012 10:07:47 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TjWrR-0003JC-OW for qemu-devel@nongnu.org; Fri, 14 Dec 2012 10:07:42 -0500 Received: from mx1.redhat.com ([209.132.183.28]:30443) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TjWrR-0003J5-G9 for qemu-devel@nongnu.org; Fri, 14 Dec 2012 10:07:37 -0500 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id qBEF7aDA028031 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 14 Dec 2012 10:07:36 -0500 Message-ID: <50CB40B4.5050207@redhat.com> Date: Fri, 14 Dec 2012 16:07:32 +0100 From: Paolo Bonzini 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> <50CB272C.5020103@redhat.com> <50CB2D64.2030408@redhat.com> <50CB3219.8000804@redhat.com> <50CB3562.5030007@redhat.com> In-Reply-To: <50CB3562.5030007@redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 3/3] chardev: add hotplug support. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gerd Hoffmann Cc: qemu-devel@nongnu.org Il 14/12/2012 15:19, Gerd Hoffmann ha scritto: > Hi, > >>> ... are you passing a file descriptor for a pipe, a file or a >>> parallel/serial port? >> >> The open function of the file-based backends basically do (1) create >> file handles and (2) call qemu_chr_open_fd(). Right, and there's the ugliness where you can only specify an output file, not an input. >> So of you already have an >> fd the differences are gone. Well, almost. tty has an special ioctl >> callback to configure line speed. What about this then: { 'union': 'ChardevFileSource', 'data': {'path': 'str', 'fd': 'str'} } { 'type': 'ChardevFile', 'data': {'*in': 'ChardevFileSource', '*out': 'ChardevFileSource'} } { 'enum': 'ChardevPortKind', 'data': ['serial', 'parallel'] } { 'type': 'ChardevPort', 'data': {'device': 'ChardevFileSource', 'type': 'ChardevPortKind'} } { 'type': 'ChardevSpice', 'data': {'name': 'str', '*debug': 'bool'}} { 'type': 'ChardevVC', 'data': {'*width': 'int', '*height': 'int', '*cols': 'int', '*rows': 'int'}} { 'type': 'ChardevSocket', 'data': {'addr': 'SocketAddress', '*server': 'bool', '*wait': 'bool', '*nodelay': 'bool', '*telnet': 'bool'} } { 'type': 'ChardevUDP', 'data': {'peer': 'SocketAddress', '*localhost': 'str', '*localport': 'str' } } # For future extensibility... { 'ChardevDummy', 'data': {} } { 'union': 'ChardevBackend', 'data': { 'socket': 'ChardevSocket', 'winpipe': 'String', # "pipe" for _WIN32 case 'udp': 'ChardevUDP', 'file': 'ChardevFile', 'port': 'ChardevPort', 'pty': 'ChardevDummy', 'null': 'ChardevDummy', 'msmouse': 'ChardevDummy', 'braille': 'ChardevDummy', 'stdio': 'ChardevDummy', 'vc': 'ChardevVC', # Solely for HMP usage. 'legacy': 'str' } > Also you might want to pass in a socket fd ... This is already supported by socket_connect/socket_listen in qemu-sockets.c (thus by the SocketAddress QAPI union). Paolo > So I really think a -chardev > fd,type={listening-stream-socket,connected-stream-socket,datagram-socket,tty,fd-readwrite,fd-writeonly} > (+ QMP for that) will be more useful. > cheers, > Gerd >