From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LruWV-0005tf-Gp for qemu-devel@nongnu.org; Thu, 09 Apr 2009 09:42:31 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LruWR-0005n9-0v for qemu-devel@nongnu.org; Thu, 09 Apr 2009 09:42:31 -0400 Received: from [199.232.76.173] (port=52233 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LruWQ-0005mq-HQ for qemu-devel@nongnu.org; Thu, 09 Apr 2009 09:42:26 -0400 Received: from mx2.redhat.com ([66.187.237.31]:36611) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LruWP-000162-SR for qemu-devel@nongnu.org; Thu, 09 Apr 2009 09:42:26 -0400 Message-ID: <49DDFB3E.1060309@redhat.com> Date: Thu, 09 Apr 2009 15:42:22 +0200 From: Kevin Wolf MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH] qemu-io: Fix handling of bdrv_is_allocated() return value References: <1239282327-1039-1-git-send-email-kwolf@redhat.com> <20090409132629.GA17531@lst.de> In-Reply-To: <20090409132629.GA17531@lst.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Christoph Hellwig Cc: qemu-devel@nongnu.org Christoph Hellwig schrieb: > On Thu, Apr 09, 2009 at 03:05:27PM +0200, Kevin Wolf wrote: >> bdrv_is_allocated() returns a boolean which indicates if the offset is >> allocated, not 0 on success and everything else is an error. > > Yeah, the handling wa wrong before. But a return value of 0 and *pnum = > 0 seems to be a special error-ish value still which we might want to > handle. The header comment of bdrv_is_allocated() doesn't specify error conditions. ;-) You seem to be right that there is one place in block.c where *pnum = 0 is used as something like an error return value. This isn't consistent though, qcow and vmdk return non-zero values in *pnum under the same conditions. Maybe another patch to change that and bring the error message back again on *pnum == 0? Kevin