From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43097) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Whddu-000142-Q8 for qemu-devel@nongnu.org; Tue, 06 May 2014 07:34:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Whddo-0007HZ-Ld for qemu-devel@nongnu.org; Tue, 06 May 2014 07:34:38 -0400 Received: from mx1.redhat.com ([209.132.183.28]:27445) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Whddo-0007HU-Ef for qemu-devel@nongnu.org; Tue, 06 May 2014 07:34:32 -0400 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s46BYVRE025377 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 6 May 2014 07:34:31 -0400 Date: Tue, 6 May 2014 13:34:30 +0200 From: Kevin Wolf Message-ID: <20140506113430.GC3941@noname.str.redhat.com> References: <1378314038-15525-1-git-send-email-pbonzini@redhat.com> <1378314038-15525-13-git-send-email-pbonzini@redhat.com> <20140505143412.GE3317@noname.str.redhat.com> <5367A711.607@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5367A711.607@redhat.com> Subject: Re: [Qemu-devel] [PATCH v5 12/21] block: define get_block_status return value List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: qemu-devel@nongnu.org, stefanha@redhat.com Am 05.05.2014 um 16:58 hat Paolo Bonzini geschrieben: > Il 05/05/2014 16:34, Kevin Wolf ha scritto: > > I think we're missing the information whether the BDRV_BLOCK_ZERO flag > > actually comes from bs itself or from the backing chain. Do we need > > another flag or does someone have a better idea? > > Not sure if it is a better idea :) but we can duplicate the logic of > bdrv_get_co_block_status in bdrv_is_allocated. > > The observation here is that bdrv_has_zero_init should have been > changed to bdrv_unallocated_blocks_are_zero in commit c3d8688 > (block/get_block_status: fix BDRV_BLOCK_ZERO for unallocated blocks, > 2013-10-24); the logic in the commit message applies just as well to > bdrv_is_allocated. But the result still wouldn't be right. We have an implication that you can't simply reverse: If this block is unallocated and unallocated blocks read as zero, then this block reads as zero. You're trying to use something like "If the block reads as zero and unallocated blocks read as zero, it must be unallocated", which quite obviously doesn't work. Kevin