On 07/16/2013 10:29 AM, Paolo Bonzini wrote: > Signed-off-by: Paolo Bonzini <pbonz...@redhat.com> > --- > v1->v2: handle extents that are stored in bs->file > > 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(-) > > +++ b/block/qcow.c > @@ -410,7 +410,14 @@ static int64_t coroutine_fn > qcow_co_get_block_status(BlockDriverState *bs, > if (n > nb_sectors) > n = nb_sectors; > *pnum = n; > - return (cluster_offset != 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) > } > > typedef struct { > + BlockDriverState *bs; > Coroutine *co; > - int is_allocated; > + uint64_t pos; > + int64_t status; > int *pnum; > } QEDIsAllocatedCB; > > static void qed_is_allocated_cb(void *opaque, int ret, uint64_t offset, > size_t len) > { > QEDIsAllocatedCB *cb = opaque; > + BDRVQEDState *s = cb->bs->opaque; > *cb->pnum = len / BDRV_SECTOR_SIZE; > - cb->is_allocated = (ret == QED_CLUSTER_FOUND || ret == QED_CLUSTER_ZERO); > + switch (ret) { > + case QED_CLUSTER_FOUND: > + offset |= qed_offset_into_cluster(s, cb->pos); > + cb->status = 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_status(BlockDriverState *bs, > size_t sector_in_block = sector_num % s->block_sectors; > int n_sectors = s->block_sectors - sector_in_block; > uint32_t bmap_entry = le32_to_cpu(s->bmap[bmap_index]); > + uint64_t offset; > + int result; > + > logout("%p, %" PRId64 ", %d, %p\n", bs, sector_num, nb_sectors, pnum); > if (n_sectors > nb_sectors) { > n_sectors = nb_sectors; > } > *pnum = n_sectors; > - return VDI_IS_ALLOCATED(bmap_entry); > + result = VDI_IS_ALLOCATED(bmap_entry); > + if (!result) { > + return 0; On a roll with TABs. As that's whitespace only, Reviewed-by: Eric Blake <ebl...@redhat.com> -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature