From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48194) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a3KTJ-00008s-HE for qemu-devel@nongnu.org; Mon, 30 Nov 2015 04:10:13 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a3KTD-00032J-UT for qemu-devel@nongnu.org; Mon, 30 Nov 2015 04:10:09 -0500 Date: Mon, 30 Nov 2015 17:09:49 +0800 From: Fam Zheng Message-ID: <20151130090948.GA5038@ad.usersys.redhat.com> References: <1448514335-15988-1-git-send-email-famz@redhat.com> <1448514335-15988-2-git-send-email-famz@redhat.com> <20151130083848.GC18454@stefanha-x1.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20151130083848.GC18454@stefanha-x1.localdomain> Subject: Re: [Qemu-devel] [PATCH v3 01/15] block: Add "file" output parameter to block status query functions List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: Kevin Wolf , qemu-block@nongnu.org, Jeff Cody , Peter Lieven , qemu-devel@nongnu.org, Markus Armbruster , Paolo Bonzini On Mon, 11/30 16:38, Stefan Hajnoczi wrote: > On Thu, Nov 26, 2015 at 01:05:21PM +0800, Fam Zheng wrote: > > @@ -1535,13 +1541,14 @@ static int64_t coroutine_fn bdrv_co_get_block_status(BlockDriverState *bs, > > } > > } > > > > - if (bs->file && > > + if (*file && *file != bs && > > (ret & BDRV_BLOCK_DATA) && !(ret & BDRV_BLOCK_ZERO) && > > (ret & BDRV_BLOCK_OFFSET_VALID)) { > > What is the purpose of this change? The code here is to sensibly detect "zero" by going into the "file" which the offset is valid for. Now the "file" is no longer always "bs->file", so we use the returned "file" pointer instead. Fam