From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:53643) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TjVtC-0000b5-FU for qemu-devel@nongnu.org; Fri, 14 Dec 2012 09:05:27 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TjVtB-0005JS-75 for qemu-devel@nongnu.org; Fri, 14 Dec 2012 09:05:22 -0500 Received: from mx1.redhat.com ([209.132.183.28]:54457) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TjVtA-0005JI-W3 for qemu-devel@nongnu.org; Fri, 14 Dec 2012 09:05:21 -0500 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id qBEE5K7J013699 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 14 Dec 2012 09:05:20 -0500 Message-ID: <50CB3219.8000804@redhat.com> Date: Fri, 14 Dec 2012 15:05:13 +0100 From: Gerd Hoffmann 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> In-Reply-To: <50CB2D64.2030408@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: Paolo Bonzini Cc: qemu-devel@nongnu.org On 12/14/12 14:45, Paolo Bonzini wrote: > Il 14/12/2012 14:18, Gerd Hoffmann ha scritto: >> Hi, >> >>> { 'enum': 'ChardevFileMode', 'data': >>> # pty = console under Windows >>> # serial = tty under POSIX >>> [ 'file', 'pipe', 'parport', 'pty', 'serial' ] } >> >> Hmm, why this enum? I'd stay close to -chardev, i.e. specify the type >> by backend name. > > Because... > >>> { 'enum: 'ChardevFileSource', 'data': >>> [ 'path', 'fd' ] } >> >> I guess I'd just create a new backend type for file descriptor passing >> instead of fitting that into all the existing ones. > > ... 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(). So of you already have an fd the differences are gone. Well, almost. tty has an special ioctl callback to configure line speed. cheers, Gerd