From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55214) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V0AyM-0006L1-Fa for qemu-devel@nongnu.org; Fri, 19 Jul 2013 09:43:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V0AyL-0007of-5P for qemu-devel@nongnu.org; Fri, 19 Jul 2013 09:43:50 -0400 Received: from mx1.redhat.com ([209.132.183.28]:10137) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V0AyK-0007oO-Uo for qemu-devel@nongnu.org; Fri, 19 Jul 2013 09:43:49 -0400 Message-ID: <51E9428D.70507@redhat.com> Date: Fri, 19 Jul 2013 07:43:41 -0600 From: Eric Blake MIME-Version: 1.0 References: <1373992168-26043-1-git-send-email-pbonzini@redhat.com> <1373992168-26043-10-git-send-email-pbonzini@redhat.com> In-Reply-To: <1373992168-26043-10-git-send-email-pbonzini@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="aColdt2pwlWEJk0peaWNpxKluXR5dpGR4" Subject: Re: [Qemu-devel] [PATCH v2 09/17] block: introduce bdrv_get_block_status API List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: famz@redhat.com, pl@kamp.de, qemu-devel@nongnu.org, stefanha@redhat.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --aColdt2pwlWEJk0peaWNpxKluXR5dpGR4 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 07/16/2013 10:29 AM, Paolo Bonzini wrote: > For now, bdrv_get_block_status is just another name for bdrv_is_allocat= ed. > The next patches will add more flags. >=20 > This also touches all block drivers with a mostly mechanical rename. T= he > sole exception is cow; because it calls cow_co_is_allocated from the re= ad > code, we keep that function and make cow_co_get_block_status a wrapper.= >=20 > Signed-off-by: Paolo Bonzini > --- > v1->v2: rebase after vmdk changes Reviewed-by: Eric Blake >=20 > @@ -370,7 +376,7 @@ static BlockDriver bdrv_cow =3D { > =20 > .bdrv_read =3D cow_co_read, > .bdrv_write =3D cow_co_write, > - .bdrv_co_is_allocated =3D cow_co_is_allocated, > + .bdrv_co_get_block_status =3D cow_co_get_block_status, Is it worth realigning indentation now that you have a longer name? > +++ b/block/qcow.c > @@ -395,7 +395,7 @@ static uint64_t get_cluster_offset(BlockDriverState= *bs, > return cluster_offset; > } > =20 > -static int coroutine_fn qcow_co_is_allocated(BlockDriverState *bs, > +static int64_t coroutine_fn qcow_co_get_block_status(BlockDriverState = *bs, > int64_t sector_num, int nb_sectors, int *pnum) Is it worth fixing alignment while you touch this? > { > BDRVQcowState *s =3D bs->opaque; > @@ -896,7 +896,7 @@ static BlockDriver bdrv_qcow =3D { > =20 > .bdrv_co_readv =3D qcow_co_readv, > .bdrv_co_writev =3D qcow_co_writev, > - .bdrv_co_is_allocated =3D qcow_co_is_allocated, > + .bdrv_co_get_block_status =3D qcow_co_get_block_status, Another spot for realignment? > +++ b/block/qcow2.c > @@ -640,7 +640,7 @@ static int qcow2_reopen_prepare(BDRVReopenState *st= ate, > return 0; > } > =20 > -static int coroutine_fn qcow2_co_is_allocated(BlockDriverState *bs, > +static int64_t coroutine_fn qcow2_co_get_block_status(BlockDriverState= *bs, > int64_t sector_num, int nb_sectors, int *pnum) alignment? > { > BDRVQcowState *s =3D bs->opaque; > @@ -1784,7 +1784,7 @@ static BlockDriver bdrv_qcow2 =3D { > .bdrv_reopen_prepare =3D qcow2_reopen_prepare, > .bdrv_create =3D qcow2_create, > .bdrv_has_zero_init =3D bdrv_has_zero_init_1, > - .bdrv_co_is_allocated =3D qcow2_co_is_allocated, > + .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 wow, this is already an alignment mess before your change > +++ b/block/qed.c > @@ -667,7 +667,7 @@ static void qed_is_allocated_cb(void *opaque, int r= et, uint64_t offset, size_t l > } > } > =20 > -static int coroutine_fn bdrv_qed_co_is_allocated(BlockDriverState *bs,= > +static int64_t coroutine_fn bdrv_qed_co_get_block_status(BlockDriverSt= ate *bs, > int64_t sector_num, > int nb_sectors, int *= pnum) alignment > +++ b/block/raw-posix.c > @@ -1084,7 +1084,7 @@ static int raw_create(const char *filename, QEMUO= ptionParameter *options) > * 'nb_sectors' is the max value 'pnum' should be set to. If nb_secto= rs goes > * beyond the end of the disk image it will be clamped. > */ > -static int coroutine_fn raw_co_is_allocated(BlockDriverState *bs, > +static int64_t coroutine_fn raw_co_get_block_status(BlockDriverState *= bs, > int64_t sector_num, > int nb_sectors, int *pnum)= and again > { > @@ -1200,7 +1200,7 @@ static BlockDriver bdrv_file =3D { > .bdrv_close =3D raw_close, > .bdrv_create =3D raw_create, > .bdrv_has_zero_init =3D bdrv_has_zero_init_1, > - .bdrv_co_is_allocated =3D raw_co_is_allocated, > + .bdrv_co_get_block_status =3D raw_co_get_block_status, > =20 > .bdrv_aio_readv =3D raw_aio_readv, > .bdrv_aio_writev =3D raw_aio_writev, here, nothing was aligned, so you actually met status quo :) But that raises a question of consistency between drivers... > +++ b/block/raw.c > @@ -35,11 +35,11 @@ static void raw_close(BlockDriverState *bs) > { > } > =20 > -static int coroutine_fn raw_co_is_allocated(BlockDriverState *bs, > +static int64_t coroutine_fn raw_co_get_block_status(BlockDriverState *= bs, > int64_t sector_num, > int nb_sectors, int *pnum)= alignment. You get the picture; I'll quit pointing it out, since it doesn't affect semantics. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --aColdt2pwlWEJk0peaWNpxKluXR5dpGR4 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.13 (GNU/Linux) Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJR6UKNAAoJEKeha0olJ0NqU4kIAJqY5xgBm0nYf+/Tld8+iYQ9 kYMnM6C6Ov8jFLiXD4829nostL600maIW0jpO43hnAzSi3GM0p9Qc1aLLHOGxzxt gxcriQtgUHJhQH0zDl9mO7NsfubRvDXMqiLyxS48CZn9DtNDJw+6cvkKuzEZq+tN v+HyHlB2eNOaFst9htpFDfv7VNwU426z+Tk4lMATMrrU5AvwGWe4TMnfwimPtkU7 S5irSj5VlfV4/DW+ey722EYSjB31mJ4of09ZiORCcmSYpek8uoVE5/BLXorYfQt8 p6OP8ixumAkYC1NMADkXt+XGrD7vwryYBzZCAUFbHaGMmtWX0G7La4mPf4P7Vo8= =PsGs -----END PGP SIGNATURE----- --aColdt2pwlWEJk0peaWNpxKluXR5dpGR4--