Received: from eggs.gnu.org ([2001:4830:134:3::10]:54576) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aXBVl-00045V-TQ for qemu-devel@nongnu.org; Sat, 20 Feb 2016 12:40:09 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aXBVl-0000Kq-5I for qemu-devel@nongnu.org; Sat, 20 Feb 2016 12:40:05 -0500 From: Max Reitz Date: Sat, 20 Feb 2016 18:39:51 +0100 Message-Id: <1455989993-1917-3-git-send-email-mreitz@redhat.com> In-Reply-To: <1455989993-1917-1-git-send-email-mreitz@redhat.com> References: <1455989993-1917-1-git-send-email-mreitz@redhat.com> Subject: [Qemu-devel] [PATCH 2/4] block/null-{co, aio}: Return zeros when read List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-block@nongnu.org Cc: Kevin Wolf , Fam Zheng , qemu-devel@nongnu.org, Max Reitz Currently, we do not define exactly what is returned when read, but having a reliable source of zeros is always nice. Signed-off-by: Max Reitz --- block/null.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/block/null.c b/block/null.c index d90165d..ad883d9 100644 --- a/block/null.c +++ b/block/null.c @@ -90,6 +90,7 @@ static coroutine_fn int null_co_readv(BlockDriverState *bs, int64_t sector_num, int nb_sectors, QEMUIOVector *qiov) { + qemu_iovec_memset(qiov, 0, 0, nb_sectors * BDRV_SECTOR_SIZE); return null_co_common(bs); } @@ -159,6 +160,7 @@ static BlockAIOCB *null_aio_readv(BlockDriverState *bs, BlockCompletionFunc *cb, void *opaque) { + qemu_iovec_memset(qiov, 0, 0, nb_sectors * BDRV_SECTOR_SIZE); return null_aio_common(bs, cb, opaque); } -- 2.7.1