From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:54530) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QcdUa-0006WB-NG for qemu-devel@nongnu.org; Fri, 01 Jul 2011 09:10:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QcdUY-0006Cz-Hv for qemu-devel@nongnu.org; Fri, 01 Jul 2011 09:10:44 -0400 Received: from mx1.redhat.com ([209.132.183.28]:33985) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QcdUY-0006Cr-0h for qemu-devel@nongnu.org; Fri, 01 Jul 2011 09:10:42 -0400 Message-ID: <4E0DC7FB.4060304@redhat.com> Date: Fri, 01 Jul 2011 15:13:31 +0200 From: Kevin Wolf MIME-Version: 1.0 References: <1309496142-14228-1-git-send-email-famcool@gmail.com> <1309496142-14228-5-git-send-email-famcool@gmail.com> <4E0DC560.6070508@redhat.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v6 04/12] VMDK: separate vmdk_open by format version List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Fam Zheng Cc: stefanha@gmail.com, qemu-devel@nongnu.org, hch@lst.de Am 01.07.2011 15:06, schrieb Fam Zheng: >> >> bdrv_pread only ever returns 0 for success or -errno for errors. So you >> can simplify the code like this: >> >> ret = bdrv_pread(...); >> if (ret < 0) { >> goto fail_l1; >> } >> >> You have the same pattern in other places, too. > > I think bdrv_pead do return the read bytes, did you mean bdrv_read here? :) Yes, you're right, it returns the read bytes. But it's always -errno or the full byte count, there are no short reads. So my explanation wasn't quite right, but the suggestion stays the same. :-) Kevin