From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42289) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W7wf1-0001Rj-KU for qemu-devel@nongnu.org; Mon, 27 Jan 2014 19:36:20 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W7wew-0007W4-L4 for qemu-devel@nongnu.org; Mon, 27 Jan 2014 19:36:15 -0500 Received: from paradis.irqsave.net ([62.212.105.220]:48486) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W7wew-0007Vw-BJ for qemu-devel@nongnu.org; Mon, 27 Jan 2014 19:36:10 -0500 Date: Tue, 28 Jan 2014 01:36:10 +0100 From: =?iso-8859-1?Q?Beno=EEt?= Canet Message-ID: <20140128003609.GC15867@irqsave.net> References: <7dd2c1ffc9826a99ce82cc4408c5a7ccc15f1133.1390856648.git.jcody@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <7dd2c1ffc9826a99ce82cc4408c5a7ccc15f1133.1390856648.git.jcody@redhat.com> Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 2/2] block: remove qcow2 .bdrv_make_empty implementation List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jeff Cody Cc: kwolf@redhat.com, qemu-devel@nongnu.org, stefanha@redhat.com Le Monday 27 Jan 2014 =E0 16:09:13 (-0500), Jeff Cody a =E9crit : > The QCOW2 .bdrv_make_empty implementation always returns 0 for success, > but does not actually do anything. >=20 > The proper way to not support an optional driver function stub is to > just not implement it, so let's remove the stub. >=20 > Signed-off-by: Jeff Cody > --- > block/qcow2.c | 21 --------------------- > 1 file changed, 21 deletions(-) >=20 > diff --git a/block/qcow2.c b/block/qcow2.c > index 2da62b8..99a1ad1 100644 > --- a/block/qcow2.c > +++ b/block/qcow2.c > @@ -1689,26 +1689,6 @@ static int qcow2_create(const char *filename, QE= MUOptionParameter *options, > return ret; > } > =20 > -static int qcow2_make_empty(BlockDriverState *bs) > -{ > -#if 0 > - /* XXX: not correct */ > - BDRVQcowState *s =3D bs->opaque; > - uint32_t l1_length =3D s->l1_size * sizeof(uint64_t); > - int ret; > - > - memset(s->l1_table, 0, l1_length); > - if (bdrv_pwrite(bs->file, s->l1_table_offset, s->l1_table, l1_leng= th) < 0) > - return -1; > - ret =3D bdrv_truncate(bs->file, s->l1_table_offset + l1_length); > - if (ret < 0) > - return ret; > - > - l2_cache_reset(bs); > -#endif > - return 0; > -} > - > static coroutine_fn int qcow2_co_write_zeroes(BlockDriverState *bs, > int64_t sector_num, int nb_sectors, BdrvRequestFlags flags) > { > @@ -2252,7 +2232,6 @@ static BlockDriver bdrv_qcow2 =3D { > .bdrv_has_zero_init =3D bdrv_has_zero_init_1, > .bdrv_co_get_block_status =3D qcow2_co_get_block_status, > .bdrv_set_key =3D qcow2_set_key, > - .bdrv_make_empty =3D qcow2_make_empty, > =20 > .bdrv_co_readv =3D qcow2_co_readv, > .bdrv_co_writev =3D qcow2_co_writev, > --=20 > 1.8.3.1 >=20 >=20 Reviewed-by: Benoit Canet