From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1O1I2g-0006sa-SD for qemu-devel@nongnu.org; Mon, 12 Apr 2010 07:43:02 -0400 Received: from [140.186.70.92] (port=35033 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O1I2e-0006sS-Ns for qemu-devel@nongnu.org; Mon, 12 Apr 2010 07:43:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1O1I2d-0000lk-3h for qemu-devel@nongnu.org; Mon, 12 Apr 2010 07:43:00 -0400 Received: from mx20.gnu.org ([199.232.41.8]:58468) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O1I2d-0000lc-0h for qemu-devel@nongnu.org; Mon, 12 Apr 2010 07:42:59 -0400 Received: from mail.codesourcery.com ([38.113.113.100]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1O1I2c-0000xy-BN for qemu-devel@nongnu.org; Mon, 12 Apr 2010 07:42:58 -0400 From: Paul Brook Subject: Re: [Qemu-devel] Re: [PATCH 0/8] (v2) chardev, virtio-console: flow control, error handling, fixes Date: Mon, 12 Apr 2010 12:42:49 +0100 References: <1270674156-9345-1-git-send-email-amit.shah@redhat.com> <201004072358.53971.paul@codesourcery.com> <4BC2D117.30307@redhat.com> In-Reply-To: <4BC2D117.30307@redhat.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <201004121242.49368.paul@codesourcery.com> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Amit Shah , Juan Quintela , Gerd Hoffmann , "Michael S. Tsirkin" > >> The qemu chardevs can now return -EAGAIN when a non-blocking remote > >> isn't ready to accept more data. > >> > >> Comments? > > > > This is a major change in semantics. Are you sure all users handle this > > correctly? My guess is that most of the devices don't. > > I don't expect trouble here. EAGAIN is returned only for file handles > in non-blocking mode. I doubt existing users use non-blocking I/O as > this makes the current unix_write() code go busy-loop in case the > outgoing pipe is full. I'm pretty sure existing devices emulation assumes qemu_chr_write either fully completes or fails with an error. Whether a FD is nonblocking is determined by the backend used to implement the chardev, not the emulated device using the chardev. For the device emulation side of the API, unix write() semantics are IMO a bad solution. What we really want is an API for posting asynchronous writes. Paul