From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KLwIn-00016K-4j for qemu-devel@nongnu.org; Thu, 24 Jul 2008 04:35:57 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KLwIm-00015t-9Q for qemu-devel@nongnu.org; Thu, 24 Jul 2008 04:35:56 -0400 Received: from [199.232.76.173] (port=59448 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KLwIl-00015p-RH for qemu-devel@nongnu.org; Thu, 24 Jul 2008 04:35:56 -0400 Received: from mx1.redhat.com ([66.187.233.31]:33615) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KLwIm-0003mH-Bs for qemu-devel@nongnu.org; Thu, 24 Jul 2008 04:35:56 -0400 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id m6O8ZtER019047 for ; Thu, 24 Jul 2008 04:35:55 -0400 Received: from file.fab.redhat.com (file.fab.redhat.com [10.33.63.6]) by int-mx1.corp.redhat.com (8.13.1/8.13.1) with ESMTP id m6O8Zs91012181 for ; Thu, 24 Jul 2008 04:35:54 -0400 Received: (from berrange@localhost) by file.fab.redhat.com (8.13.1/8.13.1/Submit) id m6O8Zr30003743 for qemu-devel@nongnu.org; Thu, 24 Jul 2008 09:35:53 +0100 Date: Thu, 24 Jul 2008 09:35:53 +0100 From: "Daniel P. Berrange" Subject: Re: [Qemu-devel] [PATCH 2/3] Always use nonblocking mode for qemu_chr_open_fd. Message-ID: <20080724083553.GC1138@redhat.com> References: <488688E3.105@codemonkey.ws> <20080723082413.GA2291@redhat.com> <48871A7E.5030501@redhat.com> <20080723121510.GJ2291@redhat.com> <48872979.4050107@redhat.com> <48873F17.4030101@redhat.com> <48874D4A.8000604@codemonkey.ws> <48875849.60200@redhat.com> <48875CEE.6000906@codemonkey.ws> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <48875CEE.6000906@codemonkey.ws> Reply-To: "Daniel P. Berrange" , qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org On Wed, Jul 23, 2008 at 11:31:42AM -0500, Anthony Liguori wrote: > Gerd Hoffmann wrote: > >Anthony Liguori wrote: > > > >>Gerd Hoffmann wrote: > >> > >>>Comments on this one? > >>> > >>Checking every 100ms for every pty device really makes me cringe. > >> > > > >Only when unconnected, and the interval can be changed. > >And I'm certainly open for better ideas ... > > > > I don't have one. In xenconsoled, once a pty disconnected, it creates a > new pty specifically because I don't think there's any sane way to > detect reconnection. The only guarenteed reliable way I know of is using epoll(), but as I mentioned before that's Linux specific, so not immediately useful unless we're willing to drop in an alternate epoll() based main loop for Linux only, and say other OS have to use PTYs in blocking mode. Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|