From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56034) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aXtOt-0004jB-AC for qemu-devel@nongnu.org; Mon, 22 Feb 2016 11:31:59 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aXtOp-000478-F5 for qemu-devel@nongnu.org; Mon, 22 Feb 2016 11:31:55 -0500 References: <1455989993-1917-1-git-send-email-mreitz@redhat.com> <1455989993-1917-3-git-send-email-mreitz@redhat.com> From: Eric Blake Message-ID: <56CB37F0.8080805@redhat.com> Date: Mon, 22 Feb 2016 09:31:44 -0700 MIME-Version: 1.0 In-Reply-To: <1455989993-1917-3-git-send-email-mreitz@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="nHgUl5GpoFneWaqK31jnFh4WLgHlmJlnC" 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: Max Reitz , qemu-block@nongnu.org Cc: Kevin Wolf , Fam Zheng , qemu-devel@nongnu.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --nHgUl5GpoFneWaqK31jnFh4WLgHlmJlnC Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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. >=20 > Signed-off-by: Max Reitz > --- > block/null.c | 2 ++ > 1 file changed, 2 insertions(+) >=20 > 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(BlockDriverStat= e *bs, > int64_t sector_num, int nb_secto= rs, > QEMUIOVector *qiov) > { > + qemu_iovec_memset(qiov, 0, 0, nb_sectors * BDRV_SECTOR_SIZE); > return null_co_common(bs); > } 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 off for back-compat but can be turned on for guaranteed all-zero reads, sounds like it would be nicer than forcing all-zero reads. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --nHgUl5GpoFneWaqK31jnFh4WLgHlmJlnC 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 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJWyzfxAAoJEKeha0olJ0NqzRMH/1pd3ym1fHCSp1BLTXSVLn/n nX9AbT8xTiWolmLhNTssx1zDyi1calQ5JKZKhq40zLUqoBj37OfzmrHpUwEXPTCS vagVJWnakE8jZysRl//hySMMWeKtokBN6UAhSbzB+XFdgybpME5xUp7sqSSQmIxY kf0re8ng9wrKntrhnKZ7iouUsUOnQ5Xkjp0TQXtwfmunB4h7LId6CndF3eM4vIqF RIfT849iqNawy5qnVl4Un13ptu0pJGfpyOdic/MplPQytGXjhoXri2fGA/knQIzi ZU8ndEyV2Arz4pMy5IaVaAo9jsH27vLj34NW0JPl2OodrZu33QCH5w+q2SAhLC8= =Vrjn -----END PGP SIGNATURE----- --nHgUl5GpoFneWaqK31jnFh4WLgHlmJlnC--