From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39320) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aGMjj-0004aq-KH for qemu-devel@nongnu.org; Tue, 05 Jan 2016 03:13:00 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aGMjg-0006sh-EW for qemu-devel@nongnu.org; Tue, 05 Jan 2016 03:12:59 -0500 From: Fam Zheng Date: Tue, 5 Jan 2016 16:11:13 +0800 Message-Id: <1451981476-29390-13-git-send-email-famz@redhat.com> In-Reply-To: <1451981476-29390-1-git-send-email-famz@redhat.com> References: <1451981476-29390-1-git-send-email-famz@redhat.com> Subject: [Qemu-devel] [PATCH v5 12/15] block: Remove the "bs->file" test in bdrv_co_get_block_status List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Kevin Wolf , qemu-block@nongnu.org, mreitz@redhat.com, Stefan Hajnoczi , pbonzini@redhat.com Now that all drivers return the right "file" pointer, we can remove this check. Signed-off-by: Fam Zheng --- block/io.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/io.c b/block/io.c index 492c291..1ca4e61 100644 --- a/block/io.c +++ b/block/io.c @@ -1550,7 +1550,7 @@ static int64_t coroutine_fn bdrv_co_get_block_status(BlockDriverState *bs, } } - if (bs->file && *file && *file != bs && + if (*file && *file != bs && (ret & BDRV_BLOCK_DATA) && !(ret & BDRV_BLOCK_ZERO) && (ret & BDRV_BLOCK_OFFSET_VALID)) { BlockDriverState *file2; -- 2.4.3