From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NypFE-0002PJ-5l for qemu-devel@nongnu.org; Mon, 05 Apr 2010 12:33:48 -0400 Received: from [140.186.70.92] (port=34810 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NypFC-0002OW-W8 for qemu-devel@nongnu.org; Mon, 05 Apr 2010 12:33:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1NypFB-0002Ul-Hm for qemu-devel@nongnu.org; Mon, 05 Apr 2010 12:33:46 -0400 Received: from mx20.gnu.org ([199.232.41.8]:6189) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NypFB-0002Ug-GB for qemu-devel@nongnu.org; Mon, 05 Apr 2010 12:33:45 -0400 Received: from mail.codesourcery.com ([38.113.113.100]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NypFA-0007xt-P7 for qemu-devel@nongnu.org; Mon, 05 Apr 2010 12:33:45 -0400 From: Paul Brook Subject: Re: [Qemu-devel] [PATCH 1/5] char: Let the caller know how many bytes were written in case of incomplete writes Date: Mon, 5 Apr 2010 17:33:38 +0100 References: <1270471538-31275-1-git-send-email-amit.shah@redhat.com> <1270471538-31275-2-git-send-email-amit.shah@redhat.com> In-Reply-To: <1270471538-31275-2-git-send-email-amit.shah@redhat.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <201004051733.38629.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 , Gerd Hoffmann , Juan Quintela > There might be cases where a few bytes would have been sent out to char > devices and some not. Currently the return values from qemu_chr_write() > to char devs are only -1, indicating an error, or the complete length > of the string passed. > > Make 'len' a pointer instead, and indicate how much of the string was > written. The return value will either be the same as 'len' or a negative > number indicating an error condition. This seems wrong. We should not be getting recoverable errors. Paul