From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35918) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aXtcG-0002ES-VP for qemu-devel@nongnu.org; Mon, 22 Feb 2016 11:45:48 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aXtcF-0000Q6-Hd for qemu-devel@nongnu.org; Mon, 22 Feb 2016 11:45:44 -0500 References: <1455989993-1917-1-git-send-email-mreitz@redhat.com> <1455989993-1917-3-git-send-email-mreitz@redhat.com> <56CB37F0.8080805@redhat.com> From: Max Reitz Message-ID: <56CB3B29.4080805@redhat.com> Date: Mon, 22 Feb 2016 17:45:29 +0100 MIME-Version: 1.0 In-Reply-To: <56CB37F0.8080805@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="J08ASm9bRKXABGDqTV612AnI6aqbIwpgH" Subject: Re: [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: Eric Blake , qemu-block@nongnu.org Cc: Kevin Wolf , Fam Zheng , qemu-devel@nongnu.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --J08ASm9bRKXABGDqTV612AnI6aqbIwpgH Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 22.02.2016 17:31, Eric Blake wrote: > On 02/20/2016 10:39 AM, Max Reitz wrote: >> 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(BlockDriverSta= te *bs, >> int64_t sector_num, int nb_sect= ors, >> QEMUIOVector *qiov) >> { >> + qemu_iovec_memset(qiov, 0, 0, nb_sectors * BDRV_SECTOR_SIZE); >> return null_co_common(bs); >> } >=20 > Shouldn't this be made optional? That is, one of the points of null-co= > was to be as fast as possible, and the memset will slow us down. So > having an optional bool as part of the null-co setup, which defaults of= f > for back-compat but can be turned on for guaranteed all-zero reads, > sounds like it would be nicer than forcing all-zero reads. Can do, will do, thanks. Max --J08ASm9bRKXABGDqTV612AnI6aqbIwpgH Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBCAAGBQJWyzspAAoJEDuxQgLoOKytBU4IAIhBlAXtgrfhpwSHjwkJ8sdU aOgY+K6XYPZjZzFAFJidj9pkEU/8ga7pjsxBTszQfD64YThhzhv5TMB+WVuJOFAH b/mh/kvn71vL5KxSGr7ome88N0ORe4bzHEkH/B0ljkqlr68L4OjnTugEiYQpMcJl AToA1KrquQTKv0HWAGFSAPUGtp5xj2K2zw4VdnfWUYTk/K3c7rnG5v4lUrKMVNfl td9UGfwTDf+lU954mziNsQx3WktahnWsLAG8+VPMBstqsWwX9/lPNeykMAoP/thu PHHPac5SQGtnFsAu9ReyRdvRjLd+zpLzivzD4NKHjci91uT6MNq7uurjSlMIW3w= =m1oF -----END PGP SIGNATURE----- --J08ASm9bRKXABGDqTV612AnI6aqbIwpgH--