From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50385) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V0GJH-0007WN-Sf for qemu-devel@nongnu.org; Fri, 19 Jul 2013 15:25:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V0GJF-0001mI-Q6 for qemu-devel@nongnu.org; Fri, 19 Jul 2013 15:25:47 -0400 Received: from mx1.redhat.com ([209.132.183.28]:18614) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V0GJF-0001m0-FO for qemu-devel@nongnu.org; Fri, 19 Jul 2013 15:25:45 -0400 Message-ID: <51E992B0.1030609@redhat.com> Date: Fri, 19 Jul 2013 13:25:36 -0600 From: Eric Blake MIME-Version: 1.0 References: <1373992168-26043-1-git-send-email-pbonzini@redhat.com> <1373992168-26043-12-git-send-email-pbonzini@redhat.com> In-Reply-To: <1373992168-26043-12-git-send-email-pbonzini@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="GFnqMfJ7lGdNR1KPPOutUPsBsmdwLW4I9" Subject: Re: [Qemu-devel] [PATCH v2 11/17] block: return get_block_status data and flags for formats 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) --GFnqMfJ7lGdNR1KPPOutUPsBsmdwLW4I9 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 07/16/2013 10:29 AM, Paolo Bonzini wrote: > Signed-off-by: Paolo Bonzini > --- > v1->v2: handle extents that are stored in bs->file >=20 > block/cow.c | 8 +++++++- > block/qcow.c | 9 ++++++++- > block/qcow2.c | 16 ++++++++++++++-- > block/qed.c | 35 ++++++++++++++++++++++++++++------- > block/sheepdog.c | 2 +- > block/vdi.c | 13 ++++++++++++- > block/vmdk.c | 19 ++++++++++++++++++- > block/vvfat.c | 11 ++++++----- > 8 files changed, 94 insertions(+), 19 deletions(-) >=20 > +++ b/block/qcow.c > @@ -410,7 +410,14 @@ static int64_t coroutine_fn qcow_co_get_block_stat= us(BlockDriverState *bs, > if (n > nb_sectors) > n =3D nb_sectors; > *pnum =3D n; > - return (cluster_offset !=3D 0); > + if (!cluster_offset) { > + return 0; TAB damage. > +++ b/block/qed.c > @@ -652,16 +652,36 @@ static int bdrv_qed_create(const char *filename, = QEMUOptionParameter *options) > } > =20 > typedef struct { > + BlockDriverState *bs; > Coroutine *co; > - int is_allocated; > + uint64_t pos; > + int64_t status; > int *pnum; > } QEDIsAllocatedCB; > =20 > static void qed_is_allocated_cb(void *opaque, int ret, uint64_t offset= , size_t len) > { > QEDIsAllocatedCB *cb =3D opaque; > + BDRVQEDState *s =3D cb->bs->opaque; > *cb->pnum =3D len / BDRV_SECTOR_SIZE; > - cb->is_allocated =3D (ret =3D=3D QED_CLUSTER_FOUND || ret =3D=3D Q= ED_CLUSTER_ZERO); > + switch (ret) { > + case QED_CLUSTER_FOUND: > + offset |=3D qed_offset_into_cluster(s, cb->pos); > + cb->status =3D BDRV_BLOCK_DATA | BDRV_BLOCK_OFFSET_VALID | offset; > + break; Even more mix of inconsistent use of TAB. > +++ b/block/vdi.c > @@ -479,12 +479,23 @@ static int64_t coroutine_fn vdi_co_get_block_stat= us(BlockDriverState *bs, > size_t sector_in_block =3D sector_num % s->block_sectors; > int n_sectors =3D s->block_sectors - sector_in_block; > uint32_t bmap_entry =3D le32_to_cpu(s->bmap[bmap_index]); > + uint64_t offset; > + int result; > + > logout("%p, %" PRId64 ", %d, %p\n", bs, sector_num, nb_sectors, pn= um); > if (n_sectors > nb_sectors) { > n_sectors =3D nb_sectors; > } > *pnum =3D n_sectors; > - return VDI_IS_ALLOCATED(bmap_entry); > + result =3D VDI_IS_ALLOCATED(bmap_entry); > + if (!result) { > + return 0; On a roll with TABs. As that's whitespace only, Reviewed-by: Eric Blake --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --GFnqMfJ7lGdNR1KPPOutUPsBsmdwLW4I9 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/ iQEcBAEBCAAGBQJR6ZKxAAoJEKeha0olJ0NqlakH+wU7UeMTKwzr6ZscxPl1Imfj qSjmD+VAQstXueCceQEBWB94IXevjdjp9RA6yxXtOHLQy65F5ZHkdGFebAXfISmX 0i/gLGELONW4CLvbZZuil44e5TSEfxJaI1AIfPMpYpjtL1KCVFdzavdgVMjVQlUP QGeX8JhKsLgG2P/eGgYILpD98UyU6nWh3MDXHZeva+vPZzoqroWOKlNL8UZOpR3E at0GGT2EN+eNkQzzJYJEtK3kKRPTk+VsUP1mhl025PM6/15VlhYziPePVHy9h+YR nEFJjQLxo12TC+XFR7WFJwNscw852pSA2UJe/R/Yuy+WsPMht+QG/pNyAyjHfcI= =nDAg -----END PGP SIGNATURE----- --GFnqMfJ7lGdNR1KPPOutUPsBsmdwLW4I9--